[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

loislo at chromium.org loislo at chromium.org
Wed Dec 22 13:26:14 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 28831a1ed2fb529f442aa99d1ddbb5a1f5e0423f
Author: loislo at chromium.org <loislo at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Sep 15 11:17:48 2010 +0000

    2010-09-14  Ilya Tikhonovsky  <loislo at chromium.org>
    
            Reviewed by Yury Semikhatsky.
    
            WebInspector: small refactoring for monitorXHR backend property.
    
            Our Inspector API is quite big and can be simplified a bit.
            As example for single backend property like monitoringXHR we
            have 4 functions in the API. Two functions for frontend
            enableMonitoringXHR/disableMonitoringXHR and
            two functions for backend monitoringXHRWasEnabled and
            monitoringXHRWasDisabled. These functions can be replaced by
            one setMonitoringXHR with one 'in' and one 'out' argument.
            The initial state of the flag can be gathered from backend
            with help of getSettings call where additional section was
            added for backend state information.
    
            https://bugs.webkit.org/show_bug.cgi?id=45759
    
            * inspector/Inspector.idl:
            * inspector/InspectorController.cpp:
            * inspector/InspectorController.h:
            * inspector/front-end/ConsoleView.js:
            * inspector/front-end/Settings.js:
            * inspector/front-end/inspector.js:
    
    2010-09-14  Ilya Tikhonovsky  <loislo at chromium.org>
    
            Reviewed by Yury Semikhatsky.
    
            WebInspector: small refactoring for monitorXHR backend property.
    
            Our Inspector API is quite big and can be simplified a bit.
            As example for single backend property like monitoringXHR we
            have 4 functions in the API. Two functions for frontend
            enableMonitoringXHR/disableMonitoringXHR and
            two functions for backend monitoringXHRWasEnabled and
            monitoringXHRWasDisabled. These functions can be replaced by
            one setMonitoringXHR with one 'in' and one 'out' argument.
            The initial state of the flag can be gathered from backend
            with help of getSettings call where additional section was
            added for backend state information.
    
            https://bugs.webkit.org/show_bug.cgi?id=45759
    
            * inspector/Inspector.idl:
            * inspector/InspectorController.cpp:
            * inspector/InspectorController.h:
            * inspector/front-end/ConsoleView.js:
            * inspector/front-end/Settings.js:
            * inspector/front-end/inspector.js:
    
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67547 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 8728149..161e95a 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,25 @@
+2010-09-14  Ilya Tikhonovsky  <loislo at chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        WebInspector: small refactoring for monitorXHR backend property.
+
+        Our Inspector API is quite big and can be simplified a bit.
+        As example for single backend property like monitoringXHR we
+        have 4 functions in the API. Two functions for frontend
+        enableMonitoringXHR/disableMonitoringXHR and
+        two functions for backend monitoringXHRWasEnabled and
+        monitoringXHRWasDisabled. These functions can be replaced by
+        one setMonitoringXHR with one 'in' and one 'out' argument.
+        The initial state of the flag can be gathered from backend
+        with help of getSettings call where additional section was
+        added for backend state information.
+
+        https://bugs.webkit.org/show_bug.cgi?id=45759
+
+        * http/tests/inspector/console-xhr-logging.html:
+        * inspector/report-API-errors.html:
+
 2010-09-15  Steve Block  <steveblock at google.com>
 
         Reviewed by Kent Tamura.
diff --git a/LayoutTests/http/tests/inspector/console-xhr-logging.html b/LayoutTests/http/tests/inspector/console-xhr-logging.html
index 825dc05..0bd755b 100755
--- a/LayoutTests/http/tests/inspector/console-xhr-logging.html
+++ b/LayoutTests/http/tests/inspector/console-xhr-logging.html
@@ -45,26 +45,28 @@ function requestHelper(method, url)
 
 function frontend_enableXMLHttpRequestLogging(testController)
 {
-    InspectorBackend.enableMonitoringXHR();
+    InspectorBackend.setMonitoringXHR(true, function(newStatus) {
+         if (newStatus)
+            testController.notifyDone("enabled");
+    });
+
     if (WebInspector.monitoringXHREnabled)
         return "enabled";
 
     testController.waitUntilDone();
-    frontend_addSniffer(WebInspector, "monitoringXHRWasEnabled", function() {
-         testController.notifyDone("enabled");
-    });
 }
 
 function frontend_disableXMLHttpRequestLogging(testController)
 {
-    InspectorBackend.disableMonitoringXHR();
+    InspectorBackend.setMonitoringXHR(false, function(newStatus) {
+        if (!newStatus)
+            testController.notifyDone("disabled");
+    });
+
     if (!WebInspector.monitoringXHREnabled)
         return "disabled";
 
     testController.waitUntilDone();
-    frontend_addSniffer(WebInspector, "monitoringXHRWasDisabled", function() {
-        testController.notifyDone("disabled");
-    });
 }
 
 </script>
diff --git a/LayoutTests/inspector/report-API-errors.html b/LayoutTests/inspector/report-API-errors.html
index 0ddd9b8..c5dcf1a 100644
--- a/LayoutTests/inspector/report-API-errors.html
+++ b/LayoutTests/inspector/report-API-errors.html
@@ -14,8 +14,8 @@ function test()
     InspectorBackend.enableResourceTracking(1);
     InspectorBackend.enableResourceTracking();
     InspectorBackend.enableResourceTracking(true, "not a function");
-    InspectorBackend.enableMonitoringXHR(undefined);
-    InspectorBackend.disableMonitoringXHR(undefined);
+    InspectorBackend.setMonitoringXHR(true, undefined);
+    InspectorBackend.setMonitoringXHR(false, undefined);
     WebInspector_syncDispatch('{"type": "event", "domain": "dom", "event": "something-strange", "data": {}}');
 
     InspectorTest.completeTest();
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 033ace7..f9143fb 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,29 @@
+2010-09-14  Ilya Tikhonovsky  <loislo at chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        WebInspector: small refactoring for monitorXHR backend property.
+
+        Our Inspector API is quite big and can be simplified a bit.
+        As example for single backend property like monitoringXHR we
+        have 4 functions in the API. Two functions for frontend
+        enableMonitoringXHR/disableMonitoringXHR and
+        two functions for backend monitoringXHRWasEnabled and
+        monitoringXHRWasDisabled. These functions can be replaced by
+        one setMonitoringXHR with one 'in' and one 'out' argument.
+        The initial state of the flag can be gathered from backend
+        with help of getSettings call where additional section was
+        added for backend state information.
+
+        https://bugs.webkit.org/show_bug.cgi?id=45759
+
+        * inspector/Inspector.idl:
+        * inspector/InspectorController.cpp:
+        * inspector/InspectorController.h:
+        * inspector/front-end/ConsoleView.js:
+        * inspector/front-end/Settings.js:
+        * inspector/front-end/inspector.js:
+
 2010-09-15  Pavel Feldman  <pfeldman at chromium.org>
 
         Reviewed by Yury Semikhatsky.
diff --git a/WebCore/inspector/Inspector.idl b/WebCore/inspector/Inspector.idl
index 169b188..26f2653 100644
--- a/WebCore/inspector/Inspector.idl
+++ b/WebCore/inspector/Inspector.idl
@@ -44,8 +44,6 @@ module core {
         [notify] void evaluateForTestInFrontend(out long testCallId, out String script);
         [notify] void disconnectFromBackend();
         [notify] void inspectedURLChanged(out String url);
-        [notify] void monitoringXHRWasEnabled();
-        [notify] void monitoringXHRWasDisabled();
         [notify] void removeResource(out unsigned long identifier);
         [notify] void reset();
         [notify] void resetProfilesPanel();
@@ -110,8 +108,7 @@ module core {
         [handler=Controller] void enableSearchingForNode();
         [handler=Controller] void disableSearchingForNode();
 
-        [handler=Controller] void enableMonitoringXHR();
-        [handler=Controller] void disableMonitoringXHR();
+        [handler=Controller] void setMonitoringXHR(in boolean enable, out boolean newState);
 
         [handler=Controller] void enableResourceTracking(in boolean always);
         [handler=Controller] void disableResourceTracking(in boolean always);
diff --git a/WebCore/inspector/InspectorController.cpp b/WebCore/inspector/InspectorController.cpp
index 90ef344..6e48fd0 100644
--- a/WebCore/inspector/InspectorController.cpp
+++ b/WebCore/inspector/InspectorController.cpp
@@ -248,11 +248,19 @@ void InspectorController::saveSessionSettings(const String& settingsJSON)
     m_sessionSettings = InspectorValue::parseJSON(settingsJSON);
 }
 
+String InspectorController::getBackendSettings()
+{
+    RefPtr<InspectorObject> runtimeSettings = InspectorObject::create();
+    runtimeSettings->setBoolean(monitoringXHRSettingName, m_monitoringXHR);
+    return runtimeSettings->toJSONString();
+}
+
 void InspectorController::getSettings(RefPtr<InspectorObject>* settings)
 {
     *settings = InspectorObject::create();
     (*settings)->setString("application", setting(frontendSettingsSettingName()));
     (*settings)->setString("session", m_sessionSettings->toJSONString());
+    (*settings)->setString("backend", getBackendSettings());
 }
 
 void InspectorController::inspect(Node* node)
@@ -460,18 +468,13 @@ void InspectorController::setSearchingForNode(bool enabled)
     }
 }
 
-void InspectorController::setMonitoringXHR(bool enabled)
+void InspectorController::setMonitoringXHR(bool enabled, bool* newState)
 {
+    *newState = enabled;
     if (m_monitoringXHR == enabled)
         return;
     m_monitoringXHR = enabled;
     setSetting(monitoringXHRSettingName, enabled ? "true" : "false");
-    if (m_frontend) {
-        if (enabled)
-            m_frontend->monitoringXHRWasEnabled();
-        else
-            m_frontend->monitoringXHRWasDisabled();
-    }
 }
 
 void InspectorController::connectFrontend()
@@ -613,8 +616,6 @@ void InspectorController::populateScriptObjects()
     if (m_searchingForNode)
         m_frontend->searchingForNodeWasEnabled();
 
-    if (m_monitoringXHR)
-        m_frontend->monitoringXHRWasEnabled();
 
 #if ENABLE(JAVASCRIPT_DEBUGGER)
     if (m_profilerAgent->enabled())
diff --git a/WebCore/inspector/InspectorController.h b/WebCore/inspector/InspectorController.h
index 079cf55..13b6b4e 100644
--- a/WebCore/inspector/InspectorController.h
+++ b/WebCore/inspector/InspectorController.h
@@ -270,6 +270,7 @@ public:
 
 private:
     static const String& frontendSettingsSettingName();
+    String getBackendSettings();
 
     friend class InspectorBackend;
     friend class InspectorBackendDispatcher;
@@ -283,9 +284,7 @@ private:
     void enableSearchingForNode() { setSearchingForNode(true); }
     void disableSearchingForNode() { setSearchingForNode(false); }
 
-    void setMonitoringXHR(bool enabled);
-    void enableMonitoringXHR() { setMonitoringXHR(true); }
-    void disableMonitoringXHR() { setMonitoringXHR(false); }
+    void setMonitoringXHR(bool enabled, bool* newState);
     void storeLastActivePanel(const String& panelName);
     InspectorDOMAgent* domAgent() { return m_domAgent.get(); }
     void releaseFrontendLifetimeAgents();
diff --git a/WebCore/inspector/front-end/ConsoleView.js b/WebCore/inspector/front-end/ConsoleView.js
index dfb1e26..06b5564 100644
--- a/WebCore/inspector/front-end/ConsoleView.js
+++ b/WebCore/inspector/front-end/ConsoleView.js
@@ -400,10 +400,13 @@ WebInspector.ConsoleView.prototype = {
         }
 
         var contextMenu = new WebInspector.ContextMenu();
-        if (!WebInspector.monitoringXHREnabled)
-            contextMenu.appendCheckboxItem(WebInspector.UIString("XMLHttpRequest logging"), InspectorBackend.enableMonitoringXHR.bind(InspectorBackend), false);
-        else
-            contextMenu.appendCheckboxItem(WebInspector.UIString("XMLHttpRequest logging"), InspectorBackend.disableMonitoringXHR.bind(InspectorBackend), true);
+
+        function monitoringXHRWasChanged(newState)
+        {
+            WebInspector.monitoringXHREnabled = newState;
+        }
+        var itemAction = InspectorBackend.setMonitoringXHR.bind(InspectorBackend, !WebInspector.monitoringXHREnabled, monitoringXHRWasChanged);
+        contextMenu.appendCheckboxItem(WebInspector.UIString("XMLHttpRequest logging"), itemAction, WebInspector.monitoringXHREnabled);
         contextMenu.appendItem(WebInspector.UIString("Clear Console"), this.requestClearMessages.bind(this));
         contextMenu.show(event);
     },
diff --git a/WebCore/inspector/front-end/Settings.js b/WebCore/inspector/front-end/Settings.js
index 41d82f9..1261cfd 100644
--- a/WebCore/inspector/front-end/Settings.js
+++ b/WebCore/inspector/front-end/Settings.js
@@ -81,9 +81,17 @@ WebInspector.Settings.initialize = function()
         WebInspector.sessionSettings.dispatchEventToListeners("loaded");
     }
 
+    function populateBackendSettings(settingsString)
+    {
+        var settings = JSON.parse(settingsString);
+
+        WebInspector.monitoringXHREnabled = settings.monitoringXHREnabled;
+    }
+
     InspectorBackend.getSettings(function(settings) {
         populateApplicationSettings(settings.application);
         populateSessionSettings(settings.session);
+        populateBackendSettings(settings.backend);
     });
 }
 
diff --git a/WebCore/inspector/front-end/inspector.js b/WebCore/inspector/front-end/inspector.js
index cbaba2d..da77de3 100644
--- a/WebCore/inspector/front-end/inspector.js
+++ b/WebCore/inspector/front-end/inspector.js
@@ -1393,16 +1393,6 @@ WebInspector.searchingForNodeWasDisabled = function()
     this.panels.elements.searchingForNodeWasDisabled();
 }
 
-WebInspector.monitoringXHRWasEnabled = function()
-{
-    this.monitoringXHREnabled = true;
-}
-
-WebInspector.monitoringXHRWasDisabled = function()
-{
-    this.monitoringXHREnabled = false;
-}
-
 WebInspector.attachDebuggerWhenShown = function()
 {
     this.panels.scripts.attachDebuggerWhenShown();

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list