Title: [106541] trunk/Source/WebCore
Revision
106541
Author
[email protected]
Date
2012-02-02 01:12:47 -0800 (Thu, 02 Feb 2012)

Log Message

Web Inspector: pause on uncaugh exceptions state is not properly restored
https://bugs.webkit.org/show_bug.cgi?id=77558

'Pause on exceptions' state is now stored in InspectorState object so that it is
properly restored on inspected process change.

Reviewed by Vsevolod Vlasov.

* inspector/InspectorDebuggerAgent.cpp:
(DebuggerAgentState):
(WebCore::InspectorDebuggerAgent::InspectorDebuggerAgent):
(WebCore::InspectorDebuggerAgent::disable):
(WebCore::InspectorDebuggerAgent::restore):
(WebCore::InspectorDebuggerAgent::setPauseOnExceptions):
(WebCore):
(WebCore::InspectorDebuggerAgent::setPauseOnExceptionsImpl):
* inspector/InspectorDebuggerAgent.h:
(InspectorDebuggerAgent):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (106540 => 106541)


--- trunk/Source/WebCore/ChangeLog	2012-02-02 08:27:21 UTC (rev 106540)
+++ trunk/Source/WebCore/ChangeLog	2012-02-02 09:12:47 UTC (rev 106541)
@@ -1,3 +1,24 @@
+2012-02-02  Yury Semikhatsky  <[email protected]>
+
+        Web Inspector: pause on uncaugh exceptions state is not properly restored
+        https://bugs.webkit.org/show_bug.cgi?id=77558
+
+        'Pause on exceptions' state is now stored in InspectorState object so that it is
+        properly restored on inspected process change.
+
+        Reviewed by Vsevolod Vlasov.
+
+        * inspector/InspectorDebuggerAgent.cpp:
+        (DebuggerAgentState):
+        (WebCore::InspectorDebuggerAgent::InspectorDebuggerAgent):
+        (WebCore::InspectorDebuggerAgent::disable):
+        (WebCore::InspectorDebuggerAgent::restore):
+        (WebCore::InspectorDebuggerAgent::setPauseOnExceptions):
+        (WebCore):
+        (WebCore::InspectorDebuggerAgent::setPauseOnExceptionsImpl):
+        * inspector/InspectorDebuggerAgent.h:
+        (InspectorDebuggerAgent):
+
 2012-02-02  Kentaro Hara  <[email protected]>
 
         The third argument of addEventListener/removeEventListener of PeerConnection should be optional

Modified: trunk/Source/WebCore/inspector/InspectorDebuggerAgent.cpp (106540 => 106541)


--- trunk/Source/WebCore/inspector/InspectorDebuggerAgent.cpp	2012-02-02 08:27:21 UTC (rev 106540)
+++ trunk/Source/WebCore/inspector/InspectorDebuggerAgent.cpp	2012-02-02 09:12:47 UTC (rev 106541)
@@ -49,6 +49,7 @@
 namespace DebuggerAgentState {
 static const char debuggerEnabled[] = "debuggerEnabled";
 static const char _javascript_Breakpoints[] = "_javascript_Breakopints";
+static const char pauseOnExceptionsState[] = "pauseOnExceptionsState";
 };
 
 const char* InspectorDebuggerAgent::backtraceObjectGroup = "backtrace-object-group";
@@ -63,6 +64,7 @@
 {
     // FIXME: make breakReason optional so that there was no need to init it with "other".
     clearBreakDetails();
+    m_state->setLong(DebuggerAgentState::pauseOnExceptionsState, ScriptDebugServer::DontPauseOnExceptions);
 }
 
 InspectorDebuggerAgent::~InspectorDebuggerAgent()
@@ -85,6 +87,7 @@
 void InspectorDebuggerAgent::disable()
 {
     m_state->setObject(DebuggerAgentState::_javascript_Breakpoints, InspectorObject::create());
+    m_state->setLong(DebuggerAgentState::pauseOnExceptionsState, ScriptDebugServer::DontPauseOnExceptions);
     m_instrumentingAgents->setInspectorDebuggerAgent(0);
 
     stopListeningScriptDebugServer();
@@ -140,6 +143,9 @@
     if (enabled()) {
         m_frontend->globalObjectCleared();
         enable();
+        long pauseState = m_state->getLong(DebuggerAgentState::pauseOnExceptionsState);
+        String error;
+        setPauseOnExceptionsImpl(&error, pauseState);
     }
 }
 
@@ -447,9 +453,16 @@
         *errorString = "Unknown pause on exceptions mode: " + stringPauseState;
         return;
     }
+    setPauseOnExceptionsImpl(errorString, pauseState);
+}
+
+void InspectorDebuggerAgent::setPauseOnExceptionsImpl(ErrorString* errorString, int pauseState)
+{
     scriptDebugServer().setPauseOnExceptionsState(static_cast<ScriptDebugServer::PauseOnExceptionsState>(pauseState));
     if (scriptDebugServer().pauseOnExceptionsState() != pauseState)
         *errorString = "Internal error. Could not change pause on exceptions state";
+    else
+        m_state->setLong(DebuggerAgentState::pauseOnExceptionsState, pauseState);
 }
 
 void InspectorDebuggerAgent::evaluateOnCallFrame(ErrorString* errorString, const String& callFrameId, const String& _expression_, const String* const objectGroup, const bool* const includeCommandLineAPI, const bool* const returnByValue, RefPtr<InspectorObject>& result, bool* wasThrown)

Modified: trunk/Source/WebCore/inspector/InspectorDebuggerAgent.h (106540 => 106541)


--- trunk/Source/WebCore/inspector/InspectorDebuggerAgent.h	2012-02-02 08:27:21 UTC (rev 106540)
+++ trunk/Source/WebCore/inspector/InspectorDebuggerAgent.h	2012-02-02 09:12:47 UTC (rev 106541)
@@ -136,6 +136,8 @@
     virtual void didPause(ScriptState*, const ScriptValue& callFrames, const ScriptValue& exception);
     virtual void didContinue();
 
+    void setPauseOnExceptionsImpl(ErrorString*, int);
+
     PassRefPtr<InspectorObject> resolveBreakpoint(const String& breakpointId, const String& scriptId, const ScriptBreakpoint&);
     void clear();
     bool assertPaused(ErrorString*);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to