Changeset 31197 in webkit
- Timestamp:
- Mar 20, 2008 5:13:56 PM (16 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r31196 r31197 1 2008-03-20 Adam Roben <aroben@apple.com> 2 3 Allow blocking of JS event handlers/javascript: URIs per-Frame 4 5 Part of Bug 17133: Should support pausing JavaScript execution without 6 hanging the process 7 8 <http://bugs.webkit.org/show_bug.cgi?id=17133> 9 <rdar://problem/5719551> 10 11 Two new methods are added to KJSProxy: setPaused and isPaused. When 12 setPaused(true) is called, JS event handlers are blocked and 13 javascript: URIs will not be evaluated. 14 15 Reviewed by Tim Hatcher. 16 17 * bindings/js/kjs_events.cpp: 18 (WebCore::JSAbstractEventListener::handleEvent): 19 - Removed some old KJS_DEBUGGER code 20 - Don't run the handler if the KJSProxy is paused. 21 * bindings/js/kjs_proxy.cpp: 22 (WebCore::KJSProxy::KJSProxy): Initialize new member. 23 * bindings/js/kjs_proxy.h: Added new methods. 24 * loader/FrameLoader.cpp: 25 (WebCore::FrameLoader::executeScript): Don't execute the script if the 26 KJSProxy is paused. 27 1 28 2008-03-20 Jon Honeycutt <jhoneycutt@apple.com> 2 29 -
trunk/WebCore/bindings/js/kjs_events.cpp
r30787 r31197 49 49 void JSAbstractEventListener::handleEvent(Event* ele, bool isWindowEvent) 50 50 { 51 #ifdef KJS_DEBUGGER52 if (KJSDebugWin::instance() && KJSDebugWin::instance()->inSession())53 return;54 #endif55 56 51 Event* event = ele; 57 52 … … 68 63 if (!frame) 69 64 return; 70 if (!frame->scriptProxy()->isEnabled()) 65 KJSProxy* scriptProxy = frame->scriptProxy(); 66 if (!scriptProxy->isEnabled() || scriptProxy->isPaused()) 71 67 return; 72 68 73 69 JSLock lock; 74 70 75 JSGlobalObject* globalObject = frame->scriptProxy()->globalObject();71 JSGlobalObject* globalObject = scriptProxy->globalObject(); 76 72 ExecState* exec = globalObject->globalExec(); 77 73 -
trunk/WebCore/bindings/js/kjs_proxy.cpp
r30942 r31197 50 50 , m_processingTimerCallback(0) 51 51 , m_processingInlineCode(0) 52 , m_paused(false) 52 53 { 53 54 } -
trunk/WebCore/bindings/js/kjs_proxy.h
r30764 r31197 71 71 void attachDebugger(KJS::Debugger*); 72 72 73 void setPaused(bool b) { m_paused = b; } 74 bool isPaused() const { return m_paused; } 75 73 76 private: 74 77 void initScriptIfNeeded() … … 85 88 bool m_processingTimerCallback; 86 89 bool m_processingInlineCode; 90 bool m_paused; 87 91 }; 88 92 -
trunk/WebCore/loader/FrameLoader.cpp
r31083 r31197 757 757 JSValue* FrameLoader::executeScript(const String& url, int baseLine, const String& script) 758 758 { 759 if (!m_frame->scriptProxy()->isEnabled()) 759 KJSProxy* scriptProxy = m_frame->scriptProxy(); 760 761 if (!scriptProxy->isEnabled() || scriptProxy->isPaused()) 760 762 return 0; 761 763
Note: See TracChangeset
for help on using the changeset viewer.