[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.19-706-ge5415e9

yurys at chromium.org yurys at chromium.org
Thu Feb 4 21:24:45 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit 2e31c62ae1ecf033d6ddfb48fd205f9e2feaaf79
Author: yurys at chromium.org <yurys at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Jan 22 12:52:52 2010 +0000

    2010-01-22  Brian Weinstein  <bweinstein at apple.com>
    
            Reviewed by Timothy Hatcher.
    
            Web Inspector: Caught exceptions still pause the debugger.
            <https://bugs.webkit.org/show_bug.cgi?id=28622>.
    
            Turn the pauseOnExceptions variable from a bool to an int, because we now have
            3 states, in an enum: DontPauseOnExceptions, PauseOnAllExceptions, and
            PauseOnUncaughtExceptions. The status button for pausing on exceptions is now
            a tri-state button, which cycles from Don't pause (no background) to Pause on All
            (blue background) to Pause on Uncaught (purple background).
    
            Also added the ability for a status button to have more than 2 states, and added
            style rules for a CSS three state button.
    
            Added a manual test, manual-tests/debugger-caught-uncaught-exceptions.html, that
            generates caught and uncaught exceptions.
    
            * English.lproj/localizedStrings.js: Added updated Action / Click to Action text.
            * inspector/InspectorBackend.cpp:
            (WebCore::InspectorBackend::pauseOnExceptions): Changed from a bool to an int.
            (WebCore::InspectorBackend::setPauseOnExceptions): Ditto.
            * inspector/InspectorBackend.h: Ditto.
            * inspector/InspectorBackend.idl: Ditto.
            * inspector/JavaScriptDebugServer.cpp:
            (WebCore::JavaScriptDebugServer::JavaScriptDebugServer): Changed from bool to PauseOnExceptionsState.
            (WebCore::JavaScriptDebugServer::setPauseOnExceptions): Ditto.
            (WebCore::JavaScriptDebugServer::exception): Updated logic to see if we are breaking
                on uncaught exceptions, and check if we have a handler.
            * inspector/JavaScriptDebugServer.h:
            (WebCore::JavaScriptDebugServer::): Changed from bool to PauseOnExceptionsState.
            (WebCore::JavaScriptDebugServer::pauseOnExceptions): Ditto.
            * inspector/front-end/InspectorBackendStub.js:
            (.WebInspector.InspectorBackendStub.prototype.pauseOnExceptionsState): Changed from returning false to returning 0 (stub function).
            * inspector/front-end/ScriptsPanel.js:
            (WebInspector.ScriptsPanel):
            (WebInspector.ScriptsPanel.prototype._updatePauseOnExceptionsButton): Updated to new text/new cycling of variables.
            (WebInspector.ScriptsPanel.prototype._togglePauseOnExceptions): Updated to new text/new cycling of variables.
            * inspector/front-end/StatusBarButton.js:
            (WebInspector.StatusBarButton): Added the option for a different number of states.
            (WebInspector.StatusBarButton.prototype.set toggled): Added rules to toggle on/off with multiple states.
            * inspector/front-end/inspector.css: Added rules for toggled-1 and toggled-2.
            * manual-tests/debugger-caught-uncaught-exceptions.html: Added.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53696 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 404e87b..6426242 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,48 @@
+2010-01-22  Brian Weinstein  <bweinstein at apple.com>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: Caught exceptions still pause the debugger.
+        <https://bugs.webkit.org/show_bug.cgi?id=28622>.
+
+        Turn the pauseOnExceptions variable from a bool to an int, because we now have
+        3 states, in an enum: DontPauseOnExceptions, PauseOnAllExceptions, and
+        PauseOnUncaughtExceptions. The status button for pausing on exceptions is now
+        a tri-state button, which cycles from Don't pause (no background) to Pause on All
+        (blue background) to Pause on Uncaught (purple background).
+
+        Also added the ability for a status button to have more than 2 states, and added
+        style rules for a CSS three state button.
+
+        Added a manual test, manual-tests/debugger-caught-uncaught-exceptions.html, that
+        generates caught and uncaught exceptions.
+
+        * English.lproj/localizedStrings.js: Added updated Action / Click to Action text.
+        * inspector/InspectorBackend.cpp:
+        (WebCore::InspectorBackend::pauseOnExceptions): Changed from a bool to an int.
+        (WebCore::InspectorBackend::setPauseOnExceptions): Ditto.
+        * inspector/InspectorBackend.h: Ditto.
+        * inspector/InspectorBackend.idl: Ditto.
+        * inspector/JavaScriptDebugServer.cpp:
+        (WebCore::JavaScriptDebugServer::JavaScriptDebugServer): Changed from bool to PauseOnExceptionsState.
+        (WebCore::JavaScriptDebugServer::setPauseOnExceptions): Ditto.
+        (WebCore::JavaScriptDebugServer::exception): Updated logic to see if we are breaking
+            on uncaught exceptions, and check if we have a handler.
+        * inspector/JavaScriptDebugServer.h:
+        (WebCore::JavaScriptDebugServer::): Changed from bool to PauseOnExceptionsState.
+        (WebCore::JavaScriptDebugServer::pauseOnExceptions): Ditto.
+        * inspector/front-end/InspectorBackendStub.js:
+        (.WebInspector.InspectorBackendStub.prototype.pauseOnExceptionsState): Changed from returning false to returning 0 (stub function).
+        * inspector/front-end/ScriptsPanel.js:
+        (WebInspector.ScriptsPanel):
+        (WebInspector.ScriptsPanel.prototype._updatePauseOnExceptionsButton): Updated to new text/new cycling of variables.
+        (WebInspector.ScriptsPanel.prototype._togglePauseOnExceptions): Updated to new text/new cycling of variables.
+        * inspector/front-end/StatusBarButton.js:
+        (WebInspector.StatusBarButton): Added the option for a different number of states.
+        (WebInspector.StatusBarButton.prototype.set toggled): Added rules to toggle on/off with multiple states.
+        * inspector/front-end/inspector.css: Added rules for toggled-1 and toggled-2.
+        * manual-tests/debugger-caught-uncaught-exceptions.html: Added.
+
 2010-01-22  Ben Murdoch  <benm at google.com>
 
         Reviewed by Eric Seidel.
diff --git a/WebCore/inspector/InspectorBackend.cpp b/WebCore/inspector/InspectorBackend.cpp
index 025ca87..5ac1a7b 100644
--- a/WebCore/inspector/InspectorBackend.cpp
+++ b/WebCore/inspector/InspectorBackend.cpp
@@ -197,14 +197,14 @@ void InspectorBackend::stepOutOfFunctionInDebugger()
     JavaScriptDebugServer::shared().stepOutOfFunction();
 }
 
-bool InspectorBackend::pauseOnExceptions()
+long InspectorBackend::pauseOnExceptionsState()
 {
-    return JavaScriptDebugServer::shared().pauseOnExceptions();
+    return JavaScriptDebugServer::shared().pauseOnExceptionsState();
 }
 
-void InspectorBackend::setPauseOnExceptions(bool pause)
+void InspectorBackend::setPauseOnExceptionsState(long pauseState)
 {
-    JavaScriptDebugServer::shared().setPauseOnExceptions(pause);
+    JavaScriptDebugServer::shared().setPauseOnExceptionsState(static_cast<JavaScriptDebugServer::PauseOnExceptionsState>(pauseState));
 }
 
 bool InspectorBackend::profilerEnabled()
diff --git a/WebCore/inspector/InspectorBackend.h b/WebCore/inspector/InspectorBackend.h
index be01f24..739e7c9 100644
--- a/WebCore/inspector/InspectorBackend.h
+++ b/WebCore/inspector/InspectorBackend.h
@@ -84,8 +84,8 @@ public:
     void pauseInDebugger();
     void resumeDebugger();
 
-    bool pauseOnExceptions();
-    void setPauseOnExceptions(bool pause);
+    long pauseOnExceptionsState();
+    void setPauseOnExceptionsState(long pauseState);
 
     void stepOverStatementInDebugger();
     void stepIntoStatementInDebugger();
diff --git a/WebCore/inspector/InspectorBackend.idl b/WebCore/inspector/InspectorBackend.idl
index 351d244..81a78fe 100644
--- a/WebCore/inspector/InspectorBackend.idl
+++ b/WebCore/inspector/InspectorBackend.idl
@@ -62,8 +62,8 @@ module core {
         void stepIntoStatementInDebugger();
         void stepOutOfFunctionInDebugger();
 
-        boolean pauseOnExceptions();
-        void setPauseOnExceptions(in boolean pauseOnExceptions);
+        long pauseOnExceptionsState();
+        void setPauseOnExceptionsState(in long pauseOnExceptionsState);
 
         boolean profilerEnabled();
         void enableProfiler(in boolean always);
diff --git a/WebCore/inspector/JavaScriptDebugServer.cpp b/WebCore/inspector/JavaScriptDebugServer.cpp
index 8082378..4aab347 100644
--- a/WebCore/inspector/JavaScriptDebugServer.cpp
+++ b/WebCore/inspector/JavaScriptDebugServer.cpp
@@ -75,7 +75,7 @@ JavaScriptDebugServer& JavaScriptDebugServer::shared()
 
 JavaScriptDebugServer::JavaScriptDebugServer()
     : m_callingListeners(false)
-    , m_pauseOnExceptions(false)
+    , m_pauseOnExceptionsState(DontPauseOnExceptions)
     , m_pauseOnNextStatement(false)
     , m_paused(false)
     , m_doneProcessingDebuggerEvents(true)
@@ -249,9 +249,9 @@ void JavaScriptDebugServer::clearBreakpoints()
     m_breakpoints.clear();
 }
 
-void JavaScriptDebugServer::setPauseOnExceptions(bool pause)
+void JavaScriptDebugServer::setPauseOnExceptionsState(PauseOnExceptionsState pause)
 {
-    m_pauseOnExceptions = pause;
+    m_pauseOnExceptionsState = pause;
 }
 
 void JavaScriptDebugServer::pauseProgram()
@@ -542,8 +542,6 @@ void JavaScriptDebugServer::returnEvent(const DebuggerCallFrame& debuggerCallFra
 
 void JavaScriptDebugServer::exception(const DebuggerCallFrame& debuggerCallFrame, intptr_t sourceID, int lineNumber, bool hasHandler)
 {
-    UNUSED_PARAM(hasHandler);
-    
     if (m_paused)
         return;
 
@@ -551,7 +549,7 @@ void JavaScriptDebugServer::exception(const DebuggerCallFrame& debuggerCallFrame
     if (!m_currentCallFrame)
         return;
 
-    if (m_pauseOnExceptions)
+    if (m_pauseOnExceptionsState == PauseOnAllExceptions || (m_pauseOnExceptionsState == PauseOnUncaughtExceptions && !hasHandler))
         m_pauseOnNextStatement = true;
 
     m_currentCallFrame->update(debuggerCallFrame, sourceID, lineNumber);
diff --git a/WebCore/inspector/JavaScriptDebugServer.h b/WebCore/inspector/JavaScriptDebugServer.h
index 9ddec0c..b5b713d 100644
--- a/WebCore/inspector/JavaScriptDebugServer.h
+++ b/WebCore/inspector/JavaScriptDebugServer.h
@@ -68,8 +68,13 @@ namespace WebCore {
         bool hasBreakpoint(intptr_t sourceID, unsigned lineNumber) const;
         void clearBreakpoints();
 
-        bool pauseOnExceptions() const { return m_pauseOnExceptions; }
-        void setPauseOnExceptions(bool);
+        enum PauseOnExceptionsState {
+            DontPauseOnExceptions,
+            PauseOnAllExceptions,
+            PauseOnUncaughtExceptions
+        };
+        PauseOnExceptionsState pauseOnExceptionsState() const { return m_pauseOnExceptionsState; }
+        void setPauseOnExceptionsState(PauseOnExceptionsState);
 
         void pauseProgram();
         void continueProgram();
@@ -136,7 +141,7 @@ namespace WebCore {
         PageListenersMap m_pageListenersMap;
         ListenerSet m_listeners;
         bool m_callingListeners;
-        bool m_pauseOnExceptions;
+        PauseOnExceptionsState m_pauseOnExceptionsState;
         bool m_pauseOnNextStatement;
         bool m_paused;
         bool m_doneProcessingDebuggerEvents;
diff --git a/WebCore/inspector/front-end/InspectorBackendStub.js b/WebCore/inspector/front-end/InspectorBackendStub.js
index 5844a23..392ba63 100644
--- a/WebCore/inspector/front-end/InspectorBackendStub.js
+++ b/WebCore/inspector/front-end/InspectorBackendStub.js
@@ -195,12 +195,12 @@ WebInspector.InspectorBackendStub.prototype = {
     {
     },
 
-    pauseOnExceptions: function()
+    pauseOnExceptionsState: function()
     {
-        return false;
+        return 0;
     },
 
-    setPauseOnExceptions: function(value)
+    setPauseOnExceptionsState: function(value)
     {
     },
 
diff --git a/WebCore/inspector/front-end/ScriptsPanel.js b/WebCore/inspector/front-end/ScriptsPanel.js
index 20d5882..210f605 100644
--- a/WebCore/inspector/front-end/ScriptsPanel.js
+++ b/WebCore/inspector/front-end/ScriptsPanel.js
@@ -154,7 +154,7 @@ WebInspector.ScriptsPanel = function()
     this.enableToggleButton = new WebInspector.StatusBarButton("", "enable-toggle-status-bar-item");
     this.enableToggleButton.addEventListener("click", this._toggleDebugging.bind(this), false);
 
-    this.pauseOnExceptionButton = new WebInspector.StatusBarButton("", "scripts-pause-on-exceptions-status-bar-item");
+    this.pauseOnExceptionButton = new WebInspector.StatusBarButton("", "scripts-pause-on-exceptions-status-bar-item", 3);
     this.pauseOnExceptionButton.addEventListener("click", this._togglePauseOnExceptions.bind(this), false);
 
     this._breakpointsURLMap = {};
@@ -194,6 +194,13 @@ WebInspector.ScriptsPanel = function()
     this.reset();
 }
 
+// Keep these in sync with WebCore::JavaScriptDebugServer
+WebInspector.ScriptsPanel.PauseOnExceptionsState = {
+    DontPauseOnExceptions : 0,
+    PauseOnAllExceptions : 1,
+    PauseOnUncaughtExceptions: 2
+};
+
 WebInspector.ScriptsPanel.prototype = {
     toolbarItemClass: "scripts",
 
@@ -795,16 +802,18 @@ WebInspector.ScriptsPanel.prototype = {
 
         event.preventDefault();
     },
-
+    
     _updatePauseOnExceptionsButton: function()
     {
-        if (InspectorBackend.pauseOnExceptions()) {
-            this.pauseOnExceptionButton.title = WebInspector.UIString("Don't pause on exceptions.");
-            this.pauseOnExceptionButton.toggled = true;
-        } else {
-            this.pauseOnExceptionButton.title = WebInspector.UIString("Pause on exceptions.");
-            this.pauseOnExceptionButton.toggled = false;
-        }
+        if (InspectorBackend.pauseOnExceptionsState() == WebInspector.ScriptsPanel.PauseOnExceptionsState.DontPauseOnExceptions)
+            this.pauseOnExceptionButton.title = WebInspector.UIString("Don't pause on exceptions.\nClick to Pause on all exceptions.");
+        else if (InspectorBackend.pauseOnExceptionsState() == WebInspector.ScriptsPanel.PauseOnExceptionsState.PauseOnAllExceptions)
+            this.pauseOnExceptionButton.title = WebInspector.UIString("Pause on all exceptions.\nClick to Pause on uncaught exceptions.");
+        else if (InspectorBackend.pauseOnExceptionsState() == WebInspector.ScriptsPanel.PauseOnExceptionsState.PauseOnUncaughtExceptions)
+            this.pauseOnExceptionButton.title = WebInspector.UIString("Pause on uncaught exceptions.\nClick to Not pause on exceptions.");
+        
+        this.pauseOnExceptionButton.state = InspectorBackend.pauseOnExceptionsState();
+        
     },
 
     _updateDebuggerButtons: function()
@@ -907,7 +916,7 @@ WebInspector.ScriptsPanel.prototype = {
 
     _togglePauseOnExceptions: function()
     {
-        InspectorBackend.setPauseOnExceptions(!InspectorBackend.pauseOnExceptions());
+        InspectorBackend.setPauseOnExceptionsState((InspectorBackend.pauseOnExceptionsState() + 1) % this.pauseOnExceptionButton.states);
         this._updatePauseOnExceptionsButton();
     },
 
diff --git a/WebCore/inspector/front-end/StatusBarButton.js b/WebCore/inspector/front-end/StatusBarButton.js
index 5c69ed5..e29b487 100644
--- a/WebCore/inspector/front-end/StatusBarButton.js
+++ b/WebCore/inspector/front-end/StatusBarButton.js
@@ -28,7 +28,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-WebInspector.StatusBarButton = function(title, className)
+WebInspector.StatusBarButton = function(title, className, states)
 {
     this.element = document.createElement("button");
     this.element.className = className + " status-bar-item";
@@ -41,10 +41,18 @@ WebInspector.StatusBarButton = function(title, className)
     this.glyphShadow = document.createElement("div");
     this.glyphShadow.className = "glyph shadow";
     this.element.appendChild(this.glyphShadow);
-
+    
+    this.states = states;
+    if (!states)
+        this.states = 2;
+
+    if (states == 2)
+        this._state = false;
+    else
+        this._state = 0;
+    
     this.title = title;
     this.disabled = false;
-    this._toggled = false;
     this._visible = true;
 }
 
@@ -79,22 +87,44 @@ WebInspector.StatusBarButton.prototype = {
         this._title = x;
         this.element.title = x;
     },
+    
+    get state()
+    {
+        return this._state;
+    },
+    
+    set state(x)
+    {
+        if (this._state === x)
+            return;
+        
+        if (this.states === 2) {
+            if (x)
+                this.element.addStyleClass("toggled-on");
+            else
+                this.element.removeStyleClass("toggled-on");
+        } else {
+            if (x !== 0) {
+                this.element.removeStyleClass("toggled-" + this._state);
+                this.element.addStyleClass("toggled-" + x);
+            } else 
+                this.element.removeStyleClass("toggled-" + this._state);
+        }
+        this._state = x;
+    },
 
     get toggled()
     {
-        return this._toggled;
+        if (this.states !== 2)
+            throw("Only used toggled when there are 2 states, otherwise, use state");
+        return this.state;
     },
 
     set toggled(x)
     {
-        if (this._toggled === x)
-            return;
-
-        if (x)
-            this.element.addStyleClass("toggled-on");
-        else
-            this.element.removeStyleClass("toggled-on");
-        this._toggled = x;
+        if (this.states !== 2)
+            throw("Only used toggled when there are 2 states, otherwise, use state");
+        this.state = x;
     },
 
     get visible()
diff --git a/WebCore/inspector/front-end/inspector.css b/WebCore/inspector/front-end/inspector.css
index fa65f88..688cbc2 100644
--- a/WebCore/inspector/front-end/inspector.css
+++ b/WebCore/inspector/front-end/inspector.css
@@ -366,6 +366,14 @@ button.status-bar-item.toggled-on .glyph {
     background-color: rgb(66, 129, 235);
 }
 
+button.status-bar-item.toggled-1 .glyph {
+    background-color: rgb(66, 129, 235);
+}
+
+button.status-bar-item.toggled-2 .glyph {
+    background-color: purple;   
+}
+
 button.status-bar-item:disabled {
     opacity: 0.5;
     background-position: 0 0 !important;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list