[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

pfeldman at chromium.org pfeldman at chromium.org
Thu Apr 8 02:09:56 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit cfd6ecb1511e1f141e8975f4448a2a0c27265181
Author: pfeldman at chromium.org <pfeldman at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Mar 4 18:56:44 2010 +0000

    2010-03-04  Pavel Feldman  <pfeldman at chromium.org>
    
            Reviewed by Timothy Hatcher.
    
            Web Inspector: Remove two last synchronous calls from front-end to InspectorBackend.
    
            https://bugs.webkit.org/show_bug.cgi?id=35720
    
            * inspector/InspectorBackend.cpp:
            (WebCore::InspectorBackend::enableSearchingForNode):
            (WebCore::InspectorBackend::disableSearchingForNode):
            (WebCore::InspectorBackend::setPauseOnExceptionsState):
            * inspector/InspectorBackend.h:
            * inspector/InspectorBackend.idl:
            * inspector/InspectorController.cpp:
            (WebCore::InspectorController::setWindowVisible):
            (WebCore::InspectorContorller::setSearchingForNode):
            (WebCore::InspectorController::populateScriptObjects):
            * inspector/InspectorController.h:
            * inspector/InspectorFrontend.cpp:
            (WebCore::InspectorFrontend::searchingForNodeWasEnabled):
            (WebCore::InspectorFrontend::searchingForNodeWasDisabled):
            (WebCore::InspectorFrontend::updatePauseOnExceptionsState):
            * inspector/InspectorFrontend.h:
            * inspector/front-end/ElementsPanel.js:
            (WebInspector.ElementsPanel):
            (WebInspector.ElementsPanel.prototype.get statusBarItems):
            (WebInspector.ElementsPanel.prototype.hide):
            (WebInspector.ElementsPanel.prototype.reset):
            (WebInspector.ElementsPanel.prototype.searchingForNodeWasEnabled):
            (WebInspector.ElementsPanel.prototype.searchingForNodeWasDisabled):
            (WebInspector.ElementsPanel.prototype._nodeSearchButtonClicked):
            * inspector/front-end/InspectorBackendStub.js:
            (.WebInspector.InspectorBackendStub.prototype.enableSearchingForNode):
            (.WebInspector.InspectorBackendStub.prototype.disableSearchingForNode):
            (.WebInspector.InspectorBackendStub.prototype.setPauseOnExceptionsState):
            * inspector/front-end/ScriptsPanel.js:
            (WebInspector.ScriptsPanel):
            (WebInspector.ScriptsPanel.prototype.get statusBarItems):
            (WebInspector.ScriptsPanel.prototype.updatePauseOnExceptionsState):
            (WebInspector.ScriptsPanel.prototype._updateDebuggerButtons):
            (WebInspector.ScriptsPanel.prototype._togglePauseOnExceptions):
            * inspector/front-end/inspector.js:
            (WebInspector.searchingForNodeWasEnabled):
            (WebInspector.searchingForNodeWasDisabled):
            (WebInspector.updatePauseOnExceptionsState):
            WebKit/chromium:
            * src/js/InspectorControllerImpl.js:
            (devtools.InspectorBackendImpl):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55537 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 3a86ba7..753eb85 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -2,6 +2,53 @@
 
         Reviewed by Timothy Hatcher.
 
+        Web Inspector: Remove two last synchronous calls from front-end to InspectorBackend.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35720
+
+        * inspector/InspectorBackend.cpp:
+        (WebCore::InspectorBackend::enableSearchingForNode):
+        (WebCore::InspectorBackend::disableSearchingForNode):
+        (WebCore::InspectorBackend::setPauseOnExceptionsState):
+        * inspector/InspectorBackend.h:
+        * inspector/InspectorBackend.idl:
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::setWindowVisible):
+        (WebCore::InspectorContorller::setSearchingForNode):
+        (WebCore::InspectorController::populateScriptObjects):
+        * inspector/InspectorController.h:
+        * inspector/InspectorFrontend.cpp:
+        (WebCore::InspectorFrontend::searchingForNodeWasEnabled):
+        (WebCore::InspectorFrontend::searchingForNodeWasDisabled):
+        (WebCore::InspectorFrontend::updatePauseOnExceptionsState):
+        * inspector/InspectorFrontend.h:
+        * inspector/front-end/ElementsPanel.js:
+        (WebInspector.ElementsPanel):
+        (WebInspector.ElementsPanel.prototype.get statusBarItems):
+        (WebInspector.ElementsPanel.prototype.hide):
+        (WebInspector.ElementsPanel.prototype.reset):
+        (WebInspector.ElementsPanel.prototype.searchingForNodeWasEnabled):
+        (WebInspector.ElementsPanel.prototype.searchingForNodeWasDisabled):
+        (WebInspector.ElementsPanel.prototype._nodeSearchButtonClicked):
+        * inspector/front-end/InspectorBackendStub.js:
+        (.WebInspector.InspectorBackendStub.prototype.enableSearchingForNode):
+        (.WebInspector.InspectorBackendStub.prototype.disableSearchingForNode):
+        (.WebInspector.InspectorBackendStub.prototype.setPauseOnExceptionsState):
+        * inspector/front-end/ScriptsPanel.js:
+        (WebInspector.ScriptsPanel):
+        (WebInspector.ScriptsPanel.prototype.get statusBarItems):
+        (WebInspector.ScriptsPanel.prototype.updatePauseOnExceptionsState):
+        (WebInspector.ScriptsPanel.prototype._updateDebuggerButtons):
+        (WebInspector.ScriptsPanel.prototype._togglePauseOnExceptions):
+        * inspector/front-end/inspector.js:
+        (WebInspector.searchingForNodeWasEnabled):
+        (WebInspector.searchingForNodeWasDisabled):
+        (WebInspector.updatePauseOnExceptionsState):
+
+2010-03-03  Pavel Feldman  <pfeldman at chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
         Web Inspector: Clicking on an error should take me to the error
 
         https://bugs.webkit.org/show_bug.cgi?id=34860
diff --git a/WebCore/inspector/InspectorBackend.cpp b/WebCore/inspector/InspectorBackend.cpp
index 5691fdb..84fea51 100644
--- a/WebCore/inspector/InspectorBackend.cpp
+++ b/WebCore/inspector/InspectorBackend.cpp
@@ -91,17 +91,16 @@ void InspectorBackend::storeLastActivePanel(const String& panelName)
         m_inspectorController->storeLastActivePanel(panelName);
 }
 
-void InspectorBackend::toggleNodeSearch()
+void InspectorBackend::enableSearchingForNode()
 {
     if (m_inspectorController)
-        m_inspectorController->toggleSearchForNodeInPage();
+        m_inspectorController->setSearchingForNode(true);
 }
 
-bool InspectorBackend::searchingForNode()
+void InspectorBackend::disableSearchingForNode()
 {
     if (m_inspectorController)
-        return m_inspectorController->searchingForNodeInPage();
-    return false;
+        m_inspectorController->setSearchingForNode(false);
 }
 
 void InspectorBackend::enableResourceTracking(bool always)
@@ -209,14 +208,11 @@ void InspectorBackend::stepOutOfFunctionInDebugger()
     ScriptDebugServer::shared().stepOutOfFunction();
 }
 
-long InspectorBackend::pauseOnExceptionsState()
-{
-    return ScriptDebugServer::shared().pauseOnExceptionsState();
-}
-
 void InspectorBackend::setPauseOnExceptionsState(long pauseState)
 {
     ScriptDebugServer::shared().setPauseOnExceptionsState(static_cast<ScriptDebugServer::PauseOnExceptionsState>(pauseState));
+    if (InspectorFrontend* frontend = inspectorFrontend())
+        frontend->updatePauseOnExceptionsState(ScriptDebugServer::shared().pauseOnExceptionsState());
 }
 
 #endif
diff --git a/WebCore/inspector/InspectorBackend.h b/WebCore/inspector/InspectorBackend.h
index 1620e50..6b81a96 100644
--- a/WebCore/inspector/InspectorBackend.h
+++ b/WebCore/inspector/InspectorBackend.h
@@ -61,8 +61,8 @@ public:
 
     void storeLastActivePanel(const String& panelName);
 
-    void toggleNodeSearch();
-    bool searchingForNode();
+    void enableSearchingForNode();
+    void disableSearchingForNode();
 
     void enableResourceTracking(bool always);
     void disableResourceTracking(bool always);
@@ -84,7 +84,6 @@ public:
     void pauseInDebugger();
     void resumeDebugger();
 
-    long pauseOnExceptionsState();
     void setPauseOnExceptionsState(long pauseState);
 
     void stepOverStatementInDebugger();
diff --git a/WebCore/inspector/InspectorBackend.idl b/WebCore/inspector/InspectorBackend.idl
index 631b7ca..726f889 100644
--- a/WebCore/inspector/InspectorBackend.idl
+++ b/WebCore/inspector/InspectorBackend.idl
@@ -36,8 +36,8 @@ module core {
 
         void saveFrontendSettings(in DOMString settings);
 
-        void toggleNodeSearch();
-        boolean searchingForNode();
+        void enableSearchingForNode();
+        void disableSearchingForNode();
 
         void enableResourceTracking(in boolean always);
         void disableResourceTracking(in boolean always);
@@ -63,7 +63,6 @@ module core {
         void stepIntoStatementInDebugger();
         void stepOutOfFunctionInDebugger();
 
-        long pauseOnExceptionsState();
         void setPauseOnExceptionsState(in long pauseOnExceptionsState);
 
         void enableProfiler(in boolean always);
diff --git a/WebCore/inspector/InspectorController.cpp b/WebCore/inspector/InspectorController.cpp
index 60a6b50..0eb71c8 100644
--- a/WebCore/inspector/InspectorController.cpp
+++ b/WebCore/inspector/InspectorController.cpp
@@ -322,8 +322,7 @@ void InspectorController::setWindowVisible(bool visible, bool attached)
         if (debuggerWasEnabled)
             m_attachDebuggerWhenShown = true;
 #endif
-        if (m_searchingForNode)
-            toggleSearchForNodeInPage();
+        setSearchingForNode(false);
         resetScriptObjects();
         stopTimelineProfiler();
     }
@@ -476,16 +475,6 @@ void InspectorController::storeLastActivePanel(const String& panelName)
     setSetting(lastActivePanelSettingName, panelName);
 }
 
-void InspectorController::toggleSearchForNodeInPage()
-{
-    if (!enabled())
-        return;
-
-    m_searchingForNode = !m_searchingForNode;
-    if (!m_searchingForNode)
-        hideHighlight();
-}
-
 void InspectorController::mouseDidMoveOverElement(const HitTestResult& result, unsigned)
 {
     if (!enabled() || !m_searchingForNode)
@@ -506,7 +495,7 @@ void InspectorController::handleMousePressOnNode(Node* node)
     if (!node)
         return;
 
-    // inspect() will implicitly call ElementsPanel's focusedNodeChanged() and the hover feedback will be stopped there.
+    setSearchingForNode(false);
     inspect(node);
 }
 
@@ -529,6 +518,21 @@ void InspectorController::windowScriptObjectAvailable()
     ScriptGlobalObject::set(m_frontendScriptState, "InspectorFrontendHost", m_inspectorFrontendHost.get());
 }
 
+void InspectorController::setSearchingForNode(bool enabled)
+{
+    if (m_searchingForNode == enabled)
+        return;
+    m_searchingForNode = enabled;
+    if (!m_searchingForNode)
+        hideHighlight();
+    if (m_frontend) {
+        if (enabled)
+            m_frontend->searchingForNodeWasEnabled();
+        else
+            m_frontend->searchingForNodeWasDisabled();
+    }
+}
+
 void InspectorController::scriptObjectReady()
 {
     ASSERT(m_frontendScriptState);
@@ -670,6 +674,12 @@ void InspectorController::populateScriptObjects()
 
     if (m_resourceTrackingEnabled)
         m_frontend->resourceTrackingWasEnabled();
+
+    if (m_searchingForNode)
+        m_frontend->searchingForNodeWasEnabled();
+    else
+        m_frontend->searchingForNodeWasDisabled();
+
 #if ENABLE(JAVASCRIPT_DEBUGGER)
     if (m_profilerEnabled)
         m_frontend->profilerWasEnabled();
@@ -687,6 +697,10 @@ void InspectorController::populateScriptObjects()
     for (unsigned i = 0; i < messageCount; ++i)
         m_consoleMessages[i]->addToConsole(m_frontend.get());
 
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+    if (m_debuggerEnabled)
+        m_frontend->updatePauseOnExceptionsState(ScriptDebugServer::shared().pauseOnExceptionsState());
+#endif
 #if ENABLE(DATABASE)
     DatabaseResourcesMap::iterator databasesEnd = m_databaseResources.end();
     for (DatabaseResourcesMap::iterator it = m_databaseResources.begin(); it != databasesEnd; ++it)
diff --git a/WebCore/inspector/InspectorController.h b/WebCore/inspector/InspectorController.h
index 9830f46..4558f7f 100644
--- a/WebCore/inspector/InspectorController.h
+++ b/WebCore/inspector/InspectorController.h
@@ -148,7 +148,6 @@ public:
     void attachWindow();
     void detachWindow();
 
-    void toggleSearchForNodeInPage();
     bool searchingForNodeInPage() const { return m_searchingForNode; }
     void mouseDidMoveOverElement(const HitTestResult&, unsigned modifierFlags);
     void handleMousePressOnNode(Node*);
@@ -262,7 +261,11 @@ private:
     friend class InspectorBackend;
     friend class InspectorFrontendHost;
     friend class InjectedScriptHost;
+
     // Following are used from InspectorBackend and internally.
+
+    void setSearchingForNode(bool enabled);
+
     void scriptObjectReady();
     void moveWindowBy(float x, float y) const;
     void setAttachedWindow(bool);
diff --git a/WebCore/inspector/InspectorFrontend.cpp b/WebCore/inspector/InspectorFrontend.cpp
index 9a5560f..781a095 100755
--- a/WebCore/inspector/InspectorFrontend.cpp
+++ b/WebCore/inspector/InspectorFrontend.cpp
@@ -227,6 +227,25 @@ void InspectorFrontend::resourceTrackingWasDisabled()
     callSimpleFunction("resourceTrackingWasDisabled");
 }
 
+
+void InspectorFrontend::searchingForNodeWasEnabled()
+{
+    callSimpleFunction("searchingForNodeWasEnabled");
+}
+
+void InspectorFrontend::searchingForNodeWasDisabled()
+{
+    callSimpleFunction("searchingForNodeWasDisabled");
+}
+
+void InspectorFrontend::updatePauseOnExceptionsState(long state)
+{
+    ScriptFunctionCall function(m_webInspector, "dispatch"); 
+    function.appendArgument("updatePauseOnExceptionsState");
+    function.appendArgument(state);
+    function.call();
+}
+
 void InspectorFrontend::timelineProfilerWasStarted()
 {
     callSimpleFunction("timelineProfilerWasStarted");
diff --git a/WebCore/inspector/InspectorFrontend.h b/WebCore/inspector/InspectorFrontend.h
index 9a993be..861a6f7 100644
--- a/WebCore/inspector/InspectorFrontend.h
+++ b/WebCore/inspector/InspectorFrontend.h
@@ -77,6 +77,11 @@ namespace WebCore {
         void resourceTrackingWasEnabled();
         void resourceTrackingWasDisabled();
 
+        void searchingForNodeWasEnabled();
+        void searchingForNodeWasDisabled();
+
+        void updatePauseOnExceptionsState(long state);
+
 #if ENABLE(JAVASCRIPT_DEBUGGER)
         void attachDebuggerWhenShown();
         void debuggerWasEnabled();
diff --git a/WebCore/inspector/front-end/ElementsPanel.js b/WebCore/inspector/front-end/ElementsPanel.js
index 897fdd1..33a5a31 100644
--- a/WebCore/inspector/front-end/ElementsPanel.js
+++ b/WebCore/inspector/front-end/ElementsPanel.js
@@ -58,10 +58,6 @@ WebInspector.ElementsPanel = function()
         this.panel.updateProperties();
         this.panel.updateEventListeners();
 
-        if (InspectorBackend.searchingForNode()) {
-            InspectorBackend.toggleNodeSearch();
-            this.panel.nodeSearchButton.toggled = false;
-        }
         if (this._focusedDOMNode)
             InjectedScriptAccess.get(this._focusedDOMNode.injectedScriptId).addInspectedNode(this._focusedDOMNode.id, function() {});
     };
@@ -102,10 +98,8 @@ WebInspector.ElementsPanel = function()
     this.sidebarResizeElement.className = "sidebar-resizer-vertical";
     this.sidebarResizeElement.addEventListener("mousedown", this.rightSidebarResizerDragStart.bind(this), false);
 
-    this.nodeSearchButton = new WebInspector.StatusBarButton(WebInspector.UIString("Select an element in the page to inspect it."), "node-search-status-bar-item");
-    this.nodeSearchButton.addEventListener("click", this._nodeSearchButtonClicked.bind(this), false);
-
-    this.searchingForNode = false;
+    this._nodeSearchButton = new WebInspector.StatusBarButton(WebInspector.UIString("Select an element in the page to inspect it."), "node-search-status-bar-item");
+    this._nodeSearchButton.addEventListener("click", this._nodeSearchButtonClicked.bind(this), false);
 
     this.element.appendChild(this.contentElement);
     this.element.appendChild(this.sidebarElement);
@@ -126,7 +120,7 @@ WebInspector.ElementsPanel.prototype = {
 
     get statusBarItems()
     {
-        return [this.nodeSearchButton.element, this.crumbsElement];
+        return [this._nodeSearchButton.element, this.crumbsElement];
     },
 
     get defaultFocusedElement()
@@ -154,11 +148,7 @@ WebInspector.ElementsPanel.prototype = {
         WebInspector.Panel.prototype.hide.call(this);
 
         WebInspector.hoveredDOMNode = null;
-
-        if (InspectorBackend.searchingForNode()) {
-            InspectorBackend.toggleNodeSearch();
-            this.nodeSearchButton.toggled = false;
-        }
+        InspectorBackend.disableSearchingForNode();
     },
 
     resize: function()
@@ -185,11 +175,6 @@ WebInspector.ElementsPanel.prototype = {
 
         WebInspector.hoveredDOMNode = null;
 
-        if (InspectorBackend.searchingForNode()) {
-            InspectorBackend.toggleNodeSearch();
-            this.nodeSearchButton.toggled = false;
-        }
-
         this.recentlyModifiedNodes = [];
 
         delete this.currentQuery;
@@ -271,6 +256,16 @@ WebInspector.ElementsPanel.prototype = {
         InjectedScriptAccess.getDefault().performSearch(whitespaceTrimmedQuery, function() {});
     },
 
+    searchingForNodeWasEnabled: function()
+    {
+        this._nodeSearchButton.toggled = true;
+    },
+
+    searchingForNodeWasDisabled: function()
+    {
+        this._nodeSearchButton.toggled = false;
+    },
+
     _updateMatchesCount: function()
     {
         WebInspector.updateSearchMatchesCount(this._searchResults.length, this);
@@ -1108,9 +1103,10 @@ WebInspector.ElementsPanel.prototype = {
 
     _nodeSearchButtonClicked: function(event)
     {
-        InspectorBackend.toggleNodeSearch();
-
-        this.nodeSearchButton.toggled = InspectorBackend.searchingForNode();
+        if (!this._nodeSearchButton.toggled)
+            InspectorBackend.enableSearchingForNode();
+        else
+            InspectorBackend.disableSearchingForNode();
     }
 }
 
diff --git a/WebCore/inspector/front-end/InspectorBackendStub.js b/WebCore/inspector/front-end/InspectorBackendStub.js
index 5cef0b7..cef998c 100644
--- a/WebCore/inspector/front-end/InspectorBackendStub.js
+++ b/WebCore/inspector/front-end/InspectorBackendStub.js
@@ -133,6 +133,17 @@ WebInspector.InspectorBackendStub.prototype = {
         WebInspector.resourceTrackingWasDisabled();
     },
 
+
+    enableSearchingForNode: function()
+    {
+        WebInspector.searchingForNodeWasEnabled();
+    },
+
+    disableSearchingForNode: function()
+    {
+        WebInspector.searchingForNodeWasDisabled();
+    },
+
     reloadPage: function()
     {
     },
@@ -169,13 +180,9 @@ WebInspector.InspectorBackendStub.prototype = {
     {
     },
 
-    pauseOnExceptionsState: function()
-    {
-        return 0;
-    },
-
     setPauseOnExceptionsState: function(value)
     {
+        WebInspector.updatePauseOnExceptionsState(value);
     },
 
     resumeDebugger: function()
diff --git a/WebCore/inspector/front-end/ScriptsPanel.js b/WebCore/inspector/front-end/ScriptsPanel.js
index f84d4cb..ffdf205 100644
--- a/WebCore/inspector/front-end/ScriptsPanel.js
+++ b/WebCore/inspector/front-end/ScriptsPanel.js
@@ -161,8 +161,9 @@ 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", 3);
-    this.pauseOnExceptionButton.addEventListener("click", this._togglePauseOnExceptions.bind(this), false);
+    this._pauseOnExceptionButton = new WebInspector.StatusBarButton("", "scripts-pause-on-exceptions-status-bar-item", 3);
+    this._pauseOnExceptionButton.addEventListener("click", this._togglePauseOnExceptions.bind(this), false);
+    this._pauseOnExceptionButton.state = WebInspector.ScriptsPanel.PauseOnExceptionsState.DontPauseOnExceptions;
 
     this._shortcuts = {};
     var handler, shortcut;
@@ -217,7 +218,7 @@ WebInspector.ScriptsPanel.prototype = {
 
     get statusBarItems()
     {
-        return [this.enableToggleButton.element, this.pauseOnExceptionButton.element];
+        return [this.enableToggleButton.element, this._pauseOnExceptionButton.element];
     },
 
     get defaultFocusedElement()
@@ -794,17 +795,16 @@ WebInspector.ScriptsPanel.prototype = {
         event.preventDefault();
     },
     
-    _updatePauseOnExceptionsButton: function()
-    {
-        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();
-        
+    updatePauseOnExceptionsState: function(pauseOnExceptionsState)
+    {
+        if (pauseOnExceptionsState == WebInspector.ScriptsPanel.PauseOnExceptionsState.DontPauseOnExceptions)
+            this._pauseOnExceptionButton.title = WebInspector.UIString("Don't pause on exceptions.\nClick to Pause on all exceptions.");
+        else if (pauseOnExceptionsState == WebInspector.ScriptsPanel.PauseOnExceptionsState.PauseOnAllExceptions)
+            this._pauseOnExceptionButton.title = WebInspector.UIString("Pause on all exceptions.\nClick to Pause on uncaught exceptions.");
+        else if (pauseOnExceptionsState == WebInspector.ScriptsPanel.PauseOnExceptionsState.PauseOnUncaughtExceptions)
+            this._pauseOnExceptionButton.title = WebInspector.UIString("Pause on uncaught exceptions.\nClick to Not pause on exceptions.");
+
+        this._pauseOnExceptionButton.state = pauseOnExceptionsState;
     },
 
     _updateDebuggerButtons: function()
@@ -812,17 +812,15 @@ WebInspector.ScriptsPanel.prototype = {
         if (this._debuggerEnabled) {
             this.enableToggleButton.title = WebInspector.UIString("Debugging enabled. Click to disable.");
             this.enableToggleButton.toggled = true;
-            this.pauseOnExceptionButton.visible = true;
+            this._pauseOnExceptionButton.visible = true;
             this.panelEnablerView.visible = false;
         } else {
             this.enableToggleButton.title = WebInspector.UIString("Debugging disabled. Click to enable.");
             this.enableToggleButton.toggled = false;
-            this.pauseOnExceptionButton.visible = false;
+            this._pauseOnExceptionButton.visible = false;
             this.panelEnablerView.visible = true;
         }
 
-        this._updatePauseOnExceptionsButton();
-
         if (this._paused) {
             this.pauseButton.addStyleClass("paused");
 
@@ -907,8 +905,7 @@ WebInspector.ScriptsPanel.prototype = {
 
     _togglePauseOnExceptions: function()
     {
-        InspectorBackend.setPauseOnExceptionsState((InspectorBackend.pauseOnExceptionsState() + 1) % this.pauseOnExceptionButton.states);
-        this._updatePauseOnExceptionsButton();
+        InspectorBackend.setPauseOnExceptionsState((this._pauseOnExceptionButton.state + 1) % this._pauseOnExceptionButton.states);
     },
 
     _togglePause: function()
diff --git a/WebCore/inspector/front-end/inspector.js b/WebCore/inspector/front-end/inspector.js
index 6239640..ab99be1 100644
--- a/WebCore/inspector/front-end/inspector.js
+++ b/WebCore/inspector/front-end/inspector.js
@@ -1309,6 +1309,17 @@ WebInspector.resourceTrackingWasDisabled = function()
     this.panels.resources.resourceTrackingWasDisabled();
 }
 
+
+WebInspector.searchingForNodeWasEnabled = function()
+{
+    this.panels.elements.searchingForNodeWasEnabled();
+}
+
+WebInspector.searchingForNodeWasDisabled = function()
+{
+    this.panels.elements.searchingForNodeWasDisabled();
+}
+
 WebInspector.attachDebuggerWhenShown = function()
 {
     this.panels.scripts.attachDebuggerWhenShown();
@@ -1319,6 +1330,11 @@ WebInspector.debuggerWasEnabled = function()
     this.panels.scripts.debuggerWasEnabled();
 }
 
+WebInspector.updatePauseOnExceptionsState = function(pauseOnExceptionsState)
+{
+    this.panels.scripts.updatePauseOnExceptionsState(pauseOnExceptionsState);
+}
+
 WebInspector.debuggerWasDisabled = function()
 {
     this.panels.scripts.debuggerWasDisabled();
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index ff16024..22d7cc7 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -2,6 +2,18 @@
 
         Reviewed by Timothy Hatcher.
 
+        Web Inspector: Remove two last synchronous calls from front-end to InspectorBackend.
+        
+        https://bugs.webkit.org/show_bug.cgi?id=35720
+
+        * src/js/InspectorControllerImpl.js:
+        (devtools.InspectorBackendImpl):
+        (devtools.InspectorBackendImpl.prototype.setPauseOnExceptionsState):
+
+2010-03-03  Pavel Feldman  <pfeldman at chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
         Web Inspector: Remove sync access to resourceTrackingEnabled.
 
         https://bugs.webkit.org/show_bug.cgi?id=35693
diff --git a/WebKit/chromium/src/js/DevTools.js b/WebKit/chromium/src/js/DevTools.js
index 0091281..1e9288f 100644
--- a/WebKit/chromium/src/js/DevTools.js
+++ b/WebKit/chromium/src/js/DevTools.js
@@ -156,15 +156,7 @@ devtools.ToolsAgent.prototype.evaluate = function(expr)
  * @param {string} text
  */
 function debugPrint(text) {
-    var console = WebInspector.console;
-    if (console) {
-        console.addMessage(new WebInspector.ConsoleMessage(
-            WebInspector.ConsoleMessage.MessageSource.JS,
-            WebInspector.ConsoleMessage.MessageType.Log,
-            WebInspector.ConsoleMessage.MessageLevel.Log,
-            1, "chrome://devtools/<internal>", undefined, -1, text));
-    } else
-        alert(text);
+    WebInspector.log(text);
 }
 
 
@@ -368,20 +360,6 @@ InjectedScriptAccess.prototype.evaluateInCallFrame = function(callFrameId, code,
 
 (function()
 {
-var orig = WebInspector.ConsoleMessage.prototype.setMessageBody;
-WebInspector.ConsoleMessage.prototype.setMessageBody = function(args)
-{
-    for (var i = 0; i < args.length; ++i) {
-        if (typeof args[i] === "string")
-            args[i] = WebInspector.ObjectProxy.wrapPrimitiveValue(args[i]);
-    }
-    orig.call(this, args);
-};
-})();
-
-
-(function()
-{
 var orig = InjectedScriptAccess.prototype.getCompletions;
 InjectedScriptAccess.prototype.getCompletions = function(expressionString, includeInspectorCommandLineAPI, callFrameId, reportCompletions)
 {
@@ -393,16 +371,6 @@ InjectedScriptAccess.prototype.getCompletions = function(expressionString, inclu
 })();
 
 
-(function()
-{
-WebInspector.ElementsPanel.prototype._nodeSearchButtonClicked = function( event)
-{
-    InspectorBackend.toggleNodeSearch();
-    this.nodeSearchButton.toggled = !this.nodeSearchButton.toggled;
-};
-})();
-
-
 // We need to have a place for postponed tasks
 // which should be executed when all the messages between agent and frontend
 // are processed.
diff --git a/WebKit/chromium/src/js/InspectorControllerImpl.js b/WebKit/chromium/src/js/InspectorControllerImpl.js
index 03259b4..38325b6 100644
--- a/WebKit/chromium/src/js/InspectorControllerImpl.js
+++ b/WebKit/chromium/src/js/InspectorControllerImpl.js
@@ -44,8 +44,10 @@ devtools.InspectorBackendImpl = function()
     this.installInspectorControllerDelegate_("deleteCookie");
     this.installInspectorControllerDelegate_("didEvaluateForTestInFrontend");
     this.installInspectorControllerDelegate_("disableResourceTracking");
+    this.installInspectorControllerDelegate_("disableSearchingForNode");
     this.installInspectorControllerDelegate_("disableTimeline");
     this.installInspectorControllerDelegate_("enableResourceTracking");
+    this.installInspectorControllerDelegate_("enableSearchingForNode");
     this.installInspectorControllerDelegate_("enableTimeline");
     this.installInspectorControllerDelegate_("getChildNodes");
     this.installInspectorControllerDelegate_("getCookies");
@@ -74,20 +76,6 @@ devtools.InspectorBackendImpl.prototype.__proto__ = WebInspector.InspectorBacken
 
 
 /**
- * {@inheritDoc}.
- */
-devtools.InspectorBackendImpl.prototype.toggleNodeSearch = function()
-{
-    WebInspector.InspectorBackendStub.prototype.toggleNodeSearch.call(this);
-    this.callInspectorController_.call(this, "toggleNodeSearch");
-    if (!this.searchingForNode()) {
-        // This is called from ElementsPanel treeOutline's focusNodeChanged().
-        InspectorFrontendHost.activateWindow();
-    }
-};
-
-
-/**
  * @override
  */
 devtools.InspectorBackendImpl.prototype.debuggerEnabled = function()
@@ -168,16 +156,10 @@ devtools.InspectorBackendImpl.prototype.setPauseOnExceptionsState = function(sta
     this._setPauseOnExceptionsState = state;
     // TODO(yurys): support all three states. See http://crbug.com/32877
     var enabled = (state !== WebInspector.ScriptsPanel.PauseOnExceptionsState.DontPauseOnExceptions);
-    return devtools.tools.getDebuggerAgent().setPauseOnExceptions(enabled);
+    WebInspector.updatePauseOnExceptionsState(enabled ? WebInspector.ScriptsPanel.PauseOnExceptionsState.PauseOnUncaughtExceptions : WebInspector.ScriptsPanel.PauseOnExceptionsState.DontPauseOnExceptions);
+    devtools.tools.getDebuggerAgent().setPauseOnExceptions(enabled);
 };
 
-/**
- * @override
- */
-devtools.InspectorBackendImpl.prototype.pauseOnExceptionsState = function()
-{
-    return (this._setPauseOnExceptionsState || WebInspector.ScriptsPanel.PauseOnExceptionsState.DontPauseOnExceptions);
-};
 
 /**
  * @override

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list