2010-08-25 Pavel Podivilov <podivilov@chromium.org>
authoryurys@chromium.org <yurys@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Aug 2010 14:24:42 +0000 (14:24 +0000)
committeryurys@chromium.org <yurys@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Aug 2010 14:24:42 +0000 (14:24 +0000)
        Reviewed by Yury Semikhatsky.

        Web Inspector: don't stop on DOM breakpoints when all breakpoints are deactivated
        https://bugs.webkit.org/show_bug.cgi?id=44509

        * bindings/v8/ScriptDebugServer.cpp:
        (WebCore::ScriptDebugServer::ScriptDebugServer):
        (WebCore::ScriptDebugServer::setBreakpointsActivated):
        (WebCore::ScriptDebugServer::breakProgram):
        * bindings/v8/ScriptDebugServer.h:
        * inspector/InspectorDebuggerAgent.cpp:
        (WebCore::InspectorDebuggerAgent::create):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@66013 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/bindings/v8/ScriptDebugServer.cpp
WebCore/bindings/v8/ScriptDebugServer.h
WebCore/inspector/InspectorDebuggerAgent.cpp

index 238dc90..b2fba9b 100644 (file)
@@ -1,3 +1,18 @@
+2010-08-25  Pavel Podivilov  <podivilov@chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Web Inspector: don't stop on DOM breakpoints when all breakpoints are deactivated
+        https://bugs.webkit.org/show_bug.cgi?id=44509
+
+        * bindings/v8/ScriptDebugServer.cpp:
+        (WebCore::ScriptDebugServer::ScriptDebugServer):
+        (WebCore::ScriptDebugServer::setBreakpointsActivated):
+        (WebCore::ScriptDebugServer::breakProgram):
+        * bindings/v8/ScriptDebugServer.h:
+        * inspector/InspectorDebuggerAgent.cpp:
+        (WebCore::InspectorDebuggerAgent::create):
+
 2010-08-25  Yury Semikhatsky  <yurys@chromium.org>
 
         Reviewed by Pavel Feldman.
index 365d692..3f1a0c5 100644 (file)
@@ -84,6 +84,7 @@ ScriptDebugServer::ScriptDebugServer()
     : m_pauseOnExceptionsState(DontPauseOnExceptions)
     , m_pausedPage(0)
     , m_enabled(true)
+    , m_breakpointsActivated(true)
 {
 }
 
@@ -186,7 +187,7 @@ void ScriptDebugServer::clearBreakpoints()
     v8::Debug::Call(clearBreakpoints);
 }
 
-void ScriptDebugServer::setBreakpointsActivated(bool enabled)
+void ScriptDebugServer::setBreakpointsActivated(bool activated)
 {
     ensureDebuggerScriptCompiled();
     v8::HandleScope scope;
@@ -194,9 +195,11 @@ void ScriptDebugServer::setBreakpointsActivated(bool enabled)
     v8::Context::Scope contextScope(debuggerContext);
 
     v8::Local<v8::Object> args = v8::Object::New();
-    args->Set(v8::String::New("enabled"), v8::Boolean::New(enabled));
+    args->Set(v8::String::New("enabled"), v8::Boolean::New(activated));
     v8::Handle<v8::Function> setBreakpointsActivated = v8::Local<v8::Function>::Cast(m_debuggerScript.get()->Get(v8::String::New("setBreakpointsActivated")));
     v8::Debug::Call(setBreakpointsActivated, args);
+
+    m_breakpointsActivated = activated;
 }
 
 ScriptDebugServer::PauseOnExceptionsState ScriptDebugServer::pauseOnExceptionsState()
@@ -232,6 +235,9 @@ void ScriptDebugServer::breakProgram()
 {
     DEFINE_STATIC_LOCAL(v8::Persistent<v8::FunctionTemplate>, callbackTemplate, ());
 
+    if (!m_breakpointsActivated)
+        return;
+
     if (!v8::Context::InContext())
         return;
 
index 1ead86b..d1fd71f 100644 (file)
@@ -134,6 +134,8 @@ private:
     Page* m_pausedPage;
     v8::Local<v8::Context> m_pausedPageContext;
     bool m_enabled;
+
+    bool m_breakpointsActivated;
 };
 
 } // namespace WebCore
index 43f2596..357a043 100644 (file)
@@ -50,6 +50,8 @@ PassOwnPtr<InspectorDebuggerAgent> InspectorDebuggerAgent::create(InspectorContr
 {
     OwnPtr<InspectorDebuggerAgent> agent = adoptPtr(new InspectorDebuggerAgent(inspectorController, frontend));
     ScriptDebugServer::shared().clearBreakpoints();
+    // FIXME(WK44513): breakpoints activated flag should be synchronized between all front-ends
+    ScriptDebugServer::shared().setBreakpointsActivated(true);
     ScriptDebugServer::shared().addListener(agent.get(), inspectorController->inspectedPage());
     return agent.release();
 }