Title: [91176] trunk/Source/WebCore
Revision
91176
Author
[email protected]
Date
2011-07-18 02:09:36 -0700 (Mon, 18 Jul 2011)

Log Message

Web Inspector: do not pause on caught exceptions while typing in the console.
https://bugs.webkit.org/show_bug.cgi?id=64379

Reviewed by Yury Semikhatsky.

* inspector/Inspector.json:
* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
* inspector/InspectorRuntimeAgent.cpp:
(WebCore::InspectorRuntimeAgent::InspectorRuntimeAgent):
(WebCore::InspectorRuntimeAgent::evaluate):
(WebCore::InspectorRuntimeAgent::setScriptDebugServer):
* inspector/InspectorRuntimeAgent.h:
* inspector/WorkerInspectorController.cpp:
(WebCore::WorkerInspectorController::WorkerInspectorController):
* inspector/front-end/ConsoleView.js:
(WebInspector.ConsoleView.prototype.evalInInspectedWindow):
* inspector/front-end/WatchExpressionsSidebarPane.js:
(WebInspector.WatchExpressionsSection.prototype.update):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (91175 => 91176)


--- trunk/Source/WebCore/ChangeLog	2011-07-18 08:11:51 UTC (rev 91175)
+++ trunk/Source/WebCore/ChangeLog	2011-07-18 09:09:36 UTC (rev 91176)
@@ -1,3 +1,25 @@
+2011-07-18  Pavel Feldman  <[email protected]>
+
+        Web Inspector: do not pause on caught exceptions while typing in the console.
+        https://bugs.webkit.org/show_bug.cgi?id=64379
+
+        Reviewed by Yury Semikhatsky.
+
+        * inspector/Inspector.json:
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::InspectorController):
+        * inspector/InspectorRuntimeAgent.cpp:
+        (WebCore::InspectorRuntimeAgent::InspectorRuntimeAgent):
+        (WebCore::InspectorRuntimeAgent::evaluate):
+        (WebCore::InspectorRuntimeAgent::setScriptDebugServer):
+        * inspector/InspectorRuntimeAgent.h:
+        * inspector/WorkerInspectorController.cpp:
+        (WebCore::WorkerInspectorController::WorkerInspectorController):
+        * inspector/front-end/ConsoleView.js:
+        (WebInspector.ConsoleView.prototype.evalInInspectedWindow):
+        * inspector/front-end/WatchExpressionsSidebarPane.js:
+        (WebInspector.WatchExpressionsSection.prototype.update):
+
 2011-07-18  Sheriff Bot  <[email protected]>
 
         Unreviewed, rolling out r91132 and r91135.

Modified: trunk/Source/WebCore/inspector/Inspector.json (91175 => 91176)


--- trunk/Source/WebCore/inspector/Inspector.json	2011-07-18 08:11:51 UTC (rev 91175)
+++ trunk/Source/WebCore/inspector/Inspector.json	2011-07-18 09:09:36 UTC (rev 91176)
@@ -247,7 +247,8 @@
                 "parameters": [
                     { "name": "_expression_", "type": "string", "description": "_expression_ to evaluate." },
                     { "name": "objectGroup", "type": "string", "optional": true, "description": "Symbolic group name that can be used to release multiple objects." },
-                    { "name": "includeCommandLineAPI", "type": "boolean", "optional": true, "description": "Determines whether Command Line API should be available during the evaluation." }
+                    { "name": "includeCommandLineAPI", "type": "boolean", "optional": true, "description": "Determines whether Command Line API should be available during the evaluation." },
+                    { "name": "doNotPauseOnExceptions", "type": "boolean", "optional": true, "description": "Specifies whether evaluation should stop on exceptions. Overrides setPauseOnException state." }
                 ],
                 "returns": [
                     { "name": "result", "$ref": "RemoteObject", "description": "Evaluation result." },

Modified: trunk/Source/WebCore/inspector/InspectorController.cpp (91175 => 91176)


--- trunk/Source/WebCore/inspector/InspectorController.cpp	2011-07-18 08:11:51 UTC (rev 91175)
+++ trunk/Source/WebCore/inspector/InspectorController.cpp	2011-07-18 09:09:36 UTC (rev 91176)
@@ -127,6 +127,11 @@
         , m_domStorageAgent.get()
 #endif
     );
+
+#if ENABLE(_javascript__DEBUGGER)
+    m_runtimeAgent->setScriptDebugServer(&m_debuggerAgent->scriptDebugServer());
+#endif
+
     InspectorInstrumentation::bindInstrumentingAgents(m_page, m_instrumentingAgents.get());
 }
 

Modified: trunk/Source/WebCore/inspector/InspectorRuntimeAgent.cpp (91175 => 91176)


--- trunk/Source/WebCore/inspector/InspectorRuntimeAgent.cpp	2011-07-18 08:11:51 UTC (rev 91175)
+++ trunk/Source/WebCore/inspector/InspectorRuntimeAgent.cpp	2011-07-18 09:09:36 UTC (rev 91176)
@@ -38,10 +38,18 @@
 #include "InspectorValues.h"
 #include <wtf/PassRefPtr.h>
 
+
+#if ENABLE(_javascript__DEBUGGER)
+#include "ScriptDebugServer.h"
+#endif
+
 namespace WebCore {
 
 InspectorRuntimeAgent::InspectorRuntimeAgent(InjectedScriptManager* injectedScriptManager)
     : m_injectedScriptManager(injectedScriptManager)
+#if ENABLE(_javascript__DEBUGGER)
+    , m_scriptDebugServer(0)
+#endif
 {
 }
 
@@ -49,14 +57,29 @@
 {
 }
 
-void InspectorRuntimeAgent::evaluate(ErrorString* errorString, const String& _expression_, const String* const objectGroup, const bool* const includeCommandLineAPI, RefPtr<InspectorObject>* result, bool* wasThrown)
+void InspectorRuntimeAgent::evaluate(ErrorString* errorString, const String& _expression_, const String* const objectGroup, const bool* const includeCommandLineAPI, const bool* const doNotPauseOnExceptions, RefPtr<InspectorObject>* result, bool* wasThrown)
 {
     InjectedScript injectedScript = m_injectedScriptManager->injectedScriptFor(getDefaultInspectedState());
     if (injectedScript.hasNoValue()) {
         *errorString = "Inspected frame has gone";
         return;
     }
+#if ENABLE(_javascript__DEBUGGER)
+    ASSERT(m_scriptDebugServer);
+    bool pauseStateChanged = false;
+    ScriptDebugServer::PauseOnExceptionsState presentState = m_scriptDebugServer->pauseOnExceptionsState();
+    if (doNotPauseOnExceptions && *doNotPauseOnExceptions && presentState != ScriptDebugServer::DontPauseOnExceptions) {
+        m_scriptDebugServer->setPauseOnExceptionsState(ScriptDebugServer::DontPauseOnExceptions);
+        pauseStateChanged = true;
+    }
+#endif
+
     injectedScript.evaluate(errorString, _expression_, objectGroup ? *objectGroup : "", includeCommandLineAPI ? *includeCommandLineAPI : false, result, wasThrown);
+
+#if ENABLE(_javascript__DEBUGGER)
+    if (pauseStateChanged)
+        m_scriptDebugServer->setPauseOnExceptionsState(presentState);
+#endif
 }
 
 void InspectorRuntimeAgent::evaluateOn(ErrorString* errorString, const String& objectId, const String& _expression_, RefPtr<InspectorObject>* result, bool* wasThrown)
@@ -100,6 +123,13 @@
     m_injectedScriptManager->releaseObjectGroup(objectGroup);
 }
 
+#if ENABLE(_javascript__DEBUGGER)
+void InspectorRuntimeAgent::setScriptDebugServer(ScriptDebugServer* scriptDebugServer)
+{
+    m_scriptDebugServer = scriptDebugServer;
+}
+#endif
+
 } // namespace WebCore
 
 #endif // ENABLE(INSPECTOR)

Modified: trunk/Source/WebCore/inspector/InspectorRuntimeAgent.h (91175 => 91176)


--- trunk/Source/WebCore/inspector/InspectorRuntimeAgent.h	2011-07-18 08:11:51 UTC (rev 91175)
+++ trunk/Source/WebCore/inspector/InspectorRuntimeAgent.h	2011-07-18 09:09:36 UTC (rev 91176)
@@ -43,6 +43,7 @@
 class InspectorArray;
 class InspectorObject;
 class InspectorValue;
+class ScriptDebugServer;
 
 typedef String ErrorString;
 
@@ -52,19 +53,26 @@
     virtual ~InspectorRuntimeAgent();
 
     // Part of the protocol.
-    void evaluate(ErrorString*, const String& _expression_, const String* const objectGroup, const bool* const includeCommandLineAPI, RefPtr<InspectorObject>* result, bool* wasThrown);
+    void evaluate(ErrorString*, const String& _expression_, const String* const objectGroup, const bool* const includeCommandLineAPI, const bool* const doNotPauseOnExceptions, RefPtr<InspectorObject>* result, bool* wasThrown);
     void evaluateOn(ErrorString*, const String& objectId, const String& _expression_, RefPtr<InspectorObject>* result, bool* wasThrown);
     void releaseObject(ErrorString*, const String& objectId);
     void getProperties(ErrorString*, const String& objectId, bool ignoreHasOwnProperty, RefPtr<InspectorArray>* result);
     void setPropertyValue(ErrorString*, const String& objectId, const String& propertyName, const String& _expression_);
     void releaseObjectGroup(ErrorString*, const String& objectGroup);
 
+#if ENABLE(_javascript__DEBUGGER)
+    void setScriptDebugServer(ScriptDebugServer*);
+#endif
+
 protected:
     explicit InspectorRuntimeAgent(InjectedScriptManager*);
     virtual ScriptState* getDefaultInspectedState() = 0;
 
 private:
     InjectedScriptManager* m_injectedScriptManager;
+#if ENABLE(_javascript__DEBUGGER)
+    ScriptDebugServer* m_scriptDebugServer;
+#endif
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/inspector/WorkerInspectorController.cpp (91175 => 91176)


--- trunk/Source/WebCore/inspector/WorkerInspectorController.cpp	2011-07-18 08:11:51 UTC (rev 91175)
+++ trunk/Source/WebCore/inspector/WorkerInspectorController.cpp	2011-07-18 09:09:36 UTC (rev 91176)
@@ -103,6 +103,10 @@
         , 0
 #endif
     );
+
+#if ENABLE(_javascript__DEBUGGER)
+    m_runtimeAgent->setScriptDebugServer(&m_debuggerAgent->scriptDebugServer());
+#endif
 }
  
 WorkerInspectorController::~WorkerInspectorController()

Modified: trunk/Source/WebCore/inspector/front-end/ConsoleView.js (91175 => 91176)


--- trunk/Source/WebCore/inspector/front-end/ConsoleView.js	2011-07-18 08:11:51 UTC (rev 91175)
+++ trunk/Source/WebCore/inspector/front-end/ConsoleView.js	2011-07-18 09:09:36 UTC (rev 91176)
@@ -373,7 +373,7 @@
         if (!expressionString && WebInspector.panels.scripts.paused)
             WebInspector.panels.scripts.getSelectedCallFrameVariables(reportCompletions.bind(this));
         else
-            this.evalInInspectedWindow(expressionString, "completion", true, evaluated.bind(this));
+            this.evalInInspectedWindow(expressionString, "completion", true, true, evaluated.bind(this));
 
         function evaluated(result, wasThrown)
         {
@@ -560,7 +560,7 @@
         }
     },
 
-    evalInInspectedWindow: function(_expression_, objectGroup, includeCommandLineAPI, callback)
+    evalInInspectedWindow: function(_expression_, objectGroup, includeCommandLineAPI, doNotPauseOnExceptions, callback)
     {
         if (WebInspector.panels.scripts && WebInspector.panels.scripts.paused) {
             WebInspector.panels.scripts.evaluateInSelectedCallFrame(_expression_, objectGroup, includeCommandLineAPI, callback);
@@ -577,7 +577,7 @@
             if (!error)
                 callback(WebInspector.RemoteObject.fromPayload(result), wasThrown);
         }
-        RuntimeAgent.evaluate(_expression_, objectGroup, includeCommandLineAPI, evalCallback);
+        RuntimeAgent.evaluate(_expression_, objectGroup, includeCommandLineAPI, doNotPauseOnExceptions, evalCallback);
     },
 
     _enterKeyPressed: function(event)
@@ -608,7 +608,7 @@
 
             self.addMessage(new WebInspector.ConsoleCommandResult(result, wasThrown, commandMessage));
         }
-        this.evalInInspectedWindow(str, "console", true, printResult);
+        this.evalInInspectedWindow(str, "console", true, undefined, printResult);
 
         WebInspector.userMetrics.ConsoleEvaluated.record();
     },

Modified: trunk/Source/WebCore/inspector/front-end/WatchExpressionsSidebarPane.js (91175 => 91176)


--- trunk/Source/WebCore/inspector/front-end/WatchExpressionsSidebarPane.js	2011-07-18 08:11:51 UTC (rev 91175)
+++ trunk/Source/WebCore/inspector/front-end/WatchExpressionsSidebarPane.js	2011-07-18 09:09:36 UTC (rev 91176)
@@ -159,7 +159,7 @@
             if (!_expression_)
                 continue;
 
-            WebInspector.console.evalInInspectedWindow(_expression_, this._watchObjectGroupId, false, appendResult.bind(this, _expression_, i));
+            WebInspector.console.evalInInspectedWindow(_expression_, this._watchObjectGroupId, false, true, appendResult.bind(this, _expression_, i));
         }
 
         if (!propertyCount) {
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to