2010-10-28 Pavel Podivilov <podivilov@chromium.org>
authorpodivilov@chromium.org <podivilov@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Oct 2010 20:13:56 +0000 (20:13 +0000)
committerpodivilov@chromium.org <podivilov@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Oct 2010 20:13:56 +0000 (20:13 +0000)
        Reviewed by Pavel Feldman.

        Web Inspector: fix pausing on next JavaScript statement
        https://bugs.webkit.org/show_bug.cgi?id=48534

        * inspector/InspectorDebuggerAgent.cpp:
        (WebCore::InspectorDebuggerAgent::InspectorDebuggerAgent):
        (WebCore::InspectorDebuggerAgent::schedulePauseOnNextStatement):
        (WebCore::InspectorDebuggerAgent::cancelPauseOnNextStatement):
        (WebCore::InspectorDebuggerAgent::pause):
        (WebCore::InspectorDebuggerAgent::didPause):
        * inspector/InspectorDebuggerAgent.h:

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

WebCore/ChangeLog
WebCore/inspector/InspectorDebuggerAgent.cpp
WebCore/inspector/InspectorDebuggerAgent.h

index a1b75c6..dcc5f92 100644 (file)
@@ -1,3 +1,18 @@
+2010-10-28  Pavel Podivilov  <podivilov@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: fix pausing on next JavaScript statement
+        https://bugs.webkit.org/show_bug.cgi?id=48534
+
+        * inspector/InspectorDebuggerAgent.cpp:
+        (WebCore::InspectorDebuggerAgent::InspectorDebuggerAgent):
+        (WebCore::InspectorDebuggerAgent::schedulePauseOnNextStatement):
+        (WebCore::InspectorDebuggerAgent::cancelPauseOnNextStatement):
+        (WebCore::InspectorDebuggerAgent::pause):
+        (WebCore::InspectorDebuggerAgent::didPause):
+        * inspector/InspectorDebuggerAgent.h:
+
 2010-10-28  Yuzo Fujishima  <yuzo@google.com>
 
         Reviewed by David Hyatt.
index a7eacf6..ebd03e6 100644 (file)
@@ -62,6 +62,7 @@ InspectorDebuggerAgent::InspectorDebuggerAgent(InspectorController* inspectorCon
     , m_frontend(frontend)
     , m_pausedScriptState(0)
     , m_breakpointsLoaded(false)
+    , m_javaScriptPauseScheduled(false)
 {
 }
 
@@ -144,6 +145,8 @@ void InspectorDebuggerAgent::getScriptSource(const String& sourceID, String* scr
 
 void InspectorDebuggerAgent::schedulePauseOnNextStatement(DebuggerEventType type, PassRefPtr<InspectorValue> data)
 {
+    if (m_javaScriptPauseScheduled)
+        return;
     m_breakProgramDetails = InspectorObject::create();
     m_breakProgramDetails->setNumber("eventType", type);
     m_breakProgramDetails->setValue("eventData", data);
@@ -152,6 +155,8 @@ void InspectorDebuggerAgent::schedulePauseOnNextStatement(DebuggerEventType type
 
 void InspectorDebuggerAgent::cancelPauseOnNextStatement()
 {
+    if (m_javaScriptPauseScheduled)
+        return;
     m_breakProgramDetails = 0;
     ScriptDebugServer::shared().setPauseOnNextStatement(false);
 }
@@ -159,6 +164,7 @@ void InspectorDebuggerAgent::cancelPauseOnNextStatement()
 void InspectorDebuggerAgent::pause()
 {
     schedulePauseOnNextStatement(JavaScriptPauseEventType, InspectorObject::create());
+    m_javaScriptPauseScheduled = true;
 }
 
 void InspectorDebuggerAgent::resume()
@@ -309,6 +315,7 @@ void InspectorDebuggerAgent::didPause(ScriptState* scriptState)
     m_breakProgramDetails->setValue("callFrames", currentCallFrames());
 
     m_frontend->pausedScript(m_breakProgramDetails);
+    m_javaScriptPauseScheduled = false;
 }
 
 void InspectorDebuggerAgent::didContinue()
index 3825042..9501ac8 100644 (file)
@@ -106,6 +106,7 @@ private:
     bool m_breakpointsLoaded;
     static InspectorDebuggerAgent* s_debuggerAgentOnBreakpoint;
     RefPtr<InspectorObject> m_breakProgramDetails;
+    bool m_javaScriptPauseScheduled;
 };
 
 } // namespace WebCore