[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198

pfeldman at chromium.org pfeldman at chromium.org
Sun Feb 20 22:57:26 UTC 2011


The following commit has been merged in the webkit-1.3 branch:
commit 64615d4de52e63c5dcaad0c8d369d51622b40361
Author: pfeldman at chromium.org <pfeldman at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Jan 14 14:50:43 2011 +0000

    2011-01-14  Pavel Feldman  <pfeldman at chromium.org>
    
            Web Inspector: do not use this as protocol message
            dispatcher in models / agents.
            https://bugs.webkit.org/show_bug.cgi?id=52442
    
            Models should never for InspectorBackend.registerDomainDispatcher("foo", this).
            There should be a clear way to tell whether method is being called
            from within front-end or by the backend.
    
            * http/tests/inspector/debugger-test2.js:
            (initialize_DebuggerTest.InspectorTest.startDebuggerTest.startTest):
            (initialize_DebuggerTest.InspectorTest.startDebuggerTest):
            (initialize_DebuggerTest.InspectorTest.completeDebuggerTest.disableDebugger):
            (initialize_DebuggerTest.InspectorTest.showScriptSource):
    2011-01-14  Pavel Feldman  <pfeldman at chromium.org>
    
            Reviewed by Yury Semikhatsky.
    
            Web Inspector: do not use this as protocol message
            dispatcher in models / agents.
            https://bugs.webkit.org/show_bug.cgi?id=52442
    
            Models should never for InspectorBackend.registerDomainDispatcher("foo", this).
            There should be a clear way to tell whether method is being called
            from within front-end or by the backend.
    
            * inspector/front-end/DOMAgent.js:
            (WebInspector.DOMAgent):
            (WebInspector.DOMAgent.prototype.nodeForId):
            (WebInspector.DOMAgent.prototype._bindNodes):
            (WebInspector.DOMAgent.prototype._removeBreakpoints):
            (WebInspector.DOMDispatcher):
            (WebInspector.DOMDispatcher.prototype.setDocument):
            (WebInspector.DOMDispatcher.prototype.attributesUpdated):
            (WebInspector.DOMDispatcher.prototype.characterDataModified):
            (WebInspector.DOMDispatcher.prototype.setChildNodes):
            (WebInspector.DOMDispatcher.prototype.setDetachedRoot):
            (WebInspector.DOMDispatcher.prototype.childNodeCountUpdated):
            (WebInspector.DOMDispatcher.prototype.childNodeInserted):
            (WebInspector.DOMDispatcher.prototype.childNodeRemoved):
            (WebInspector.DOMDispatcher.prototype.didCommitLoad):
            (WebInspector.ApplicationCacheDispatcher):
            (WebInspector.ApplicationCacheDispatcher.prototype.getApplicationCachesAsync):
            (WebInspector.ApplicationCacheDispatcher.prototype.updateApplicationCacheStatus):
            (WebInspector.ApplicationCacheDispatcher.prototype.updateNetworkState):
            * inspector/front-end/DOMStorage.js:
            (WebInspector.DOMStorageDispatcher):
            (WebInspector.DOMStorageDispatcher.prototype.addDOMStorage):
            (WebInspector.DOMStorageDispatcher.prototype.selectDOMStorage):
            (WebInspector.DOMStorageDispatcher.prototype.updateDOMStorage):
            * inspector/front-end/Database.js:
            (WebInspector.Database.prototype.executeSql):
            (WebInspector.DatabaseDispatcher):
            (WebInspector.DatabaseDispatcher.prototype.addDatabase):
            (WebInspector.DatabaseDispatcher.prototype.selectDatabase):
            (WebInspector.DatabaseDispatcher.prototype.sqlTransactionSucceeded):
            (WebInspector.DatabaseDispatcher.prototype.sqlTransactionFailed):
            * inspector/front-end/DebuggerModel.js:
            (WebInspector.DebuggerModel):
            (WebInspector.DebuggerModel.prototype._pausedScript):
            (WebInspector.DebuggerModel.prototype._resumedScript):
            (WebInspector.DebuggerModel.prototype._parsedScriptSource):
            (WebInspector.DebuggerModel.prototype._failedToParseScriptSource):
            (WebInspector.DebuggerDispatcher):
            (WebInspector.DebuggerDispatcher.prototype.pausedScript):
            (WebInspector.DebuggerDispatcher.prototype.resumedScript):
            (WebInspector.DebuggerDispatcher.prototype.parsedScriptSource):
            (WebInspector.DebuggerDispatcher.prototype.failedToParseScriptSource):
            * inspector/front-end/FileSystemView.js:
            (WebInspector.FileSystemDispatcher):
            (WebInspector.FileSystemDispatcher.prototype.getFileSystemPathsAsync):
            (WebInspector.FileSystemDispatcher.prototype.didGetFileSystemPath):
            (WebInspector.FileSystemDispatcher.prototype.didGetFileSystemError):
            (WebInspector.FileSystemDispatcher.prototype.didGetFileSystemDisabled):
            * inspector/front-end/ProfilesPanel.js:
            (WebInspector.ProfilesPanel):
            (WebInspector.ProfilesPanel.prototype._addProfileHeader):
            (WebInspector.ProfilesPanel.prototype._removeProfileHeader):
            (WebInspector.ProfilesPanel.prototype._addHeapSnapshotChunk):
            (WebInspector.ProfilesPanel.prototype._finishHeapSnapshot):
            (WebInspector.ProfilesPanel.prototype._setRecordingProfile):
            (WebInspector.ProfilerDispatcher):
            (WebInspector.ProfilerDispatcher.prototype.profilerWasEnabled):
            (WebInspector.ProfilerDispatcher.prototype.profilerWasDisabled):
            (WebInspector.ProfilerDispatcher.prototype.resetProfiles):
            (WebInspector.ProfilerDispatcher.prototype.addProfileHeader):
            (WebInspector.ProfilerDispatcher.prototype.addHeapSnapshotChunk):
            (WebInspector.ProfilerDispatcher.prototype.finishHeapSnapshot):
            (WebInspector.ProfilerDispatcher.prototype.setRecordingProfile):
            (WebInspector.ProfileSidebarTreeElement.prototype.ondelete):
            * inspector/front-end/ResourceTreeModel.js:
            (WebInspector.ResourceTreeModel):
            * inspector/front-end/TimelinePanel.js:
            (WebInspector.TimelinePanel):
            (WebInspector.TimelinePanel.prototype._timelineProfilerWasStarted):
            (WebInspector.TimelinePanel.prototype._timelineProfilerWasStopped):
            (WebInspector.TimelinePanel.prototype._addRecordToTimeline):
            (WebInspector.TimelineDispatcher):
            (WebInspector.TimelineDispatcher.prototype.timelineProfilerWasStarted):
            (WebInspector.TimelineDispatcher.prototype.timelineProfilerWasStopped):
            (WebInspector.TimelineDispatcher.prototype.addRecordToTimeline):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75791 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 103a843..5551206 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,19 @@
+2011-01-14  Pavel Feldman  <pfeldman at chromium.org>
+
+        Web Inspector: do not use this as protocol message
+        dispatcher in models / agents.
+        https://bugs.webkit.org/show_bug.cgi?id=52442
+
+        Models should never for InspectorBackend.registerDomainDispatcher("foo", this).
+        There should be a clear way to tell whether method is being called
+        from within front-end or by the backend.
+
+        * http/tests/inspector/debugger-test2.js:
+        (initialize_DebuggerTest.InspectorTest.startDebuggerTest.startTest):
+        (initialize_DebuggerTest.InspectorTest.startDebuggerTest):
+        (initialize_DebuggerTest.InspectorTest.completeDebuggerTest.disableDebugger):
+        (initialize_DebuggerTest.InspectorTest.showScriptSource):
+
 2011-01-14  Andrey Kosyakov  <caseq at chromium.org>
 
         Unreviewed test fix.
diff --git a/LayoutTests/http/tests/inspector/debugger-test2.js b/LayoutTests/http/tests/inspector/debugger-test2.js
index 4134613..da2bac3 100644
--- a/LayoutTests/http/tests/inspector/debugger-test2.js
+++ b/LayoutTests/http/tests/inspector/debugger-test2.js
@@ -7,15 +7,15 @@ InspectorTest.startDebuggerTest = function(callback)
     if (WebInspector.panels.scripts._debuggerEnabled)
         startTest();
     else {
-        InspectorTest._addSniffer(WebInspector.debuggerModel, "debuggerWasEnabled", startTest);
+        InspectorTest._addSniffer(WebInspector.panels.scripts, "debuggerWasEnabled", startTest);
         WebInspector.panels.scripts._toggleDebugging(false);
     }
 
     function startTest()
     {
         InspectorTest.addResult("Debugger was enabled.");
-        InspectorTest._addSniffer(WebInspector.debuggerModel, "pausedScript", InspectorTest._pausedScript, true);
-        InspectorTest._addSniffer(WebInspector.debuggerModel, "resumedScript", InspectorTest._resumedScript, true);
+        InspectorTest._addSniffer(WebInspector.debuggerModel, "_pausedScript", InspectorTest._pausedScript, true);
+        InspectorTest._addSniffer(WebInspector.debuggerModel, "_resumedScript", InspectorTest._resumedScript, true);
         callback();
     }
 };
@@ -34,7 +34,7 @@ InspectorTest.completeDebuggerTest = function()
         if (!scriptsPanel._debuggerEnabled)
             completeTest();
         else {
-            InspectorTest._addSniffer(WebInspector.debuggerModel, "debuggerWasDisabled", completeTest);
+            InspectorTest._addSniffer(WebInspector.panels.scripts, "debuggerWasDisabled", completeTest);
             scriptsPanel._toggleDebugging(false);
         }
     }
@@ -124,7 +124,7 @@ InspectorTest.showScriptSource = function(scriptName, callback)
     if (InspectorTest._scriptsAreParsed([scriptName]))
         InspectorTest._showScriptSource(scriptName, callback);
     else
-        InspectorTest._addSniffer(WebInspector.debuggerModel, "parsedScriptSource", InspectorTest.showScriptSource.bind(InspectorTest, scriptName, callback));
+        InspectorTest._addSniffer(WebInspector.debuggerModel, "_parsedScriptSource", InspectorTest.showScriptSource.bind(InspectorTest, scriptName, callback));
 };
 
 InspectorTest.waitUntilCurrentSourceFrameIsLoaded = function(callback)
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 4b0d43e..021226a 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,91 @@
+2011-01-14  Pavel Feldman  <pfeldman at chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Web Inspector: do not use this as protocol message
+        dispatcher in models / agents.
+        https://bugs.webkit.org/show_bug.cgi?id=52442
+
+        Models should never for InspectorBackend.registerDomainDispatcher("foo", this).
+        There should be a clear way to tell whether method is being called
+        from within front-end or by the backend.
+
+        * inspector/front-end/DOMAgent.js:
+        (WebInspector.DOMAgent):
+        (WebInspector.DOMAgent.prototype.nodeForId):
+        (WebInspector.DOMAgent.prototype._bindNodes):
+        (WebInspector.DOMAgent.prototype._removeBreakpoints):
+        (WebInspector.DOMDispatcher):
+        (WebInspector.DOMDispatcher.prototype.setDocument):
+        (WebInspector.DOMDispatcher.prototype.attributesUpdated):
+        (WebInspector.DOMDispatcher.prototype.characterDataModified):
+        (WebInspector.DOMDispatcher.prototype.setChildNodes):
+        (WebInspector.DOMDispatcher.prototype.setDetachedRoot):
+        (WebInspector.DOMDispatcher.prototype.childNodeCountUpdated):
+        (WebInspector.DOMDispatcher.prototype.childNodeInserted):
+        (WebInspector.DOMDispatcher.prototype.childNodeRemoved):
+        (WebInspector.DOMDispatcher.prototype.didCommitLoad):
+        (WebInspector.ApplicationCacheDispatcher):
+        (WebInspector.ApplicationCacheDispatcher.prototype.getApplicationCachesAsync):
+        (WebInspector.ApplicationCacheDispatcher.prototype.updateApplicationCacheStatus):
+        (WebInspector.ApplicationCacheDispatcher.prototype.updateNetworkState):
+        * inspector/front-end/DOMStorage.js:
+        (WebInspector.DOMStorageDispatcher):
+        (WebInspector.DOMStorageDispatcher.prototype.addDOMStorage):
+        (WebInspector.DOMStorageDispatcher.prototype.selectDOMStorage):
+        (WebInspector.DOMStorageDispatcher.prototype.updateDOMStorage):
+        * inspector/front-end/Database.js:
+        (WebInspector.Database.prototype.executeSql):
+        (WebInspector.DatabaseDispatcher):
+        (WebInspector.DatabaseDispatcher.prototype.addDatabase):
+        (WebInspector.DatabaseDispatcher.prototype.selectDatabase):
+        (WebInspector.DatabaseDispatcher.prototype.sqlTransactionSucceeded):
+        (WebInspector.DatabaseDispatcher.prototype.sqlTransactionFailed):
+        * inspector/front-end/DebuggerModel.js:
+        (WebInspector.DebuggerModel):
+        (WebInspector.DebuggerModel.prototype._pausedScript):
+        (WebInspector.DebuggerModel.prototype._resumedScript):
+        (WebInspector.DebuggerModel.prototype._parsedScriptSource):
+        (WebInspector.DebuggerModel.prototype._failedToParseScriptSource):
+        (WebInspector.DebuggerDispatcher):
+        (WebInspector.DebuggerDispatcher.prototype.pausedScript):
+        (WebInspector.DebuggerDispatcher.prototype.resumedScript):
+        (WebInspector.DebuggerDispatcher.prototype.parsedScriptSource):
+        (WebInspector.DebuggerDispatcher.prototype.failedToParseScriptSource):
+        * inspector/front-end/FileSystemView.js:
+        (WebInspector.FileSystemDispatcher):
+        (WebInspector.FileSystemDispatcher.prototype.getFileSystemPathsAsync):
+        (WebInspector.FileSystemDispatcher.prototype.didGetFileSystemPath):
+        (WebInspector.FileSystemDispatcher.prototype.didGetFileSystemError):
+        (WebInspector.FileSystemDispatcher.prototype.didGetFileSystemDisabled):
+        * inspector/front-end/ProfilesPanel.js:
+        (WebInspector.ProfilesPanel):
+        (WebInspector.ProfilesPanel.prototype._addProfileHeader):
+        (WebInspector.ProfilesPanel.prototype._removeProfileHeader):
+        (WebInspector.ProfilesPanel.prototype._addHeapSnapshotChunk):
+        (WebInspector.ProfilesPanel.prototype._finishHeapSnapshot):
+        (WebInspector.ProfilesPanel.prototype._setRecordingProfile):
+        (WebInspector.ProfilerDispatcher):
+        (WebInspector.ProfilerDispatcher.prototype.profilerWasEnabled):
+        (WebInspector.ProfilerDispatcher.prototype.profilerWasDisabled):
+        (WebInspector.ProfilerDispatcher.prototype.resetProfiles):
+        (WebInspector.ProfilerDispatcher.prototype.addProfileHeader):
+        (WebInspector.ProfilerDispatcher.prototype.addHeapSnapshotChunk):
+        (WebInspector.ProfilerDispatcher.prototype.finishHeapSnapshot):
+        (WebInspector.ProfilerDispatcher.prototype.setRecordingProfile):
+        (WebInspector.ProfileSidebarTreeElement.prototype.ondelete):
+        * inspector/front-end/ResourceTreeModel.js:
+        (WebInspector.ResourceTreeModel):
+        * inspector/front-end/TimelinePanel.js:
+        (WebInspector.TimelinePanel):
+        (WebInspector.TimelinePanel.prototype._timelineProfilerWasStarted):
+        (WebInspector.TimelinePanel.prototype._timelineProfilerWasStopped):
+        (WebInspector.TimelinePanel.prototype._addRecordToTimeline):
+        (WebInspector.TimelineDispatcher):
+        (WebInspector.TimelineDispatcher.prototype.timelineProfilerWasStarted):
+        (WebInspector.TimelineDispatcher.prototype.timelineProfilerWasStopped):
+        (WebInspector.TimelineDispatcher.prototype.addRecordToTimeline):
+
 2011-01-14  Csaba Osztrogonác  <ossy at webkit.org>
 
         [Qt][V8] Unreviewed buildfix after r75788.
diff --git a/Source/WebCore/inspector/front-end/DOMAgent.js b/Source/WebCore/inspector/front-end/DOMAgent.js
index 89822a3..27abc62 100644
--- a/Source/WebCore/inspector/front-end/DOMAgent.js
+++ b/Source/WebCore/inspector/front-end/DOMAgent.js
@@ -300,7 +300,7 @@ WebInspector.DOMAgent = function() {
     this._window = new WebInspector.DOMWindow(this);
     this._idToDOMNode = null;
     this.document = null;
-    InspectorBackend.registerDomainDispatcher("DOM", this);
+    InspectorBackend.registerDomainDispatcher("DOM", new WebInspector.DOMDispatcher(this));
 }
 
 WebInspector.DOMAgent.prototype = {
@@ -351,7 +351,7 @@ WebInspector.DOMAgent.prototype = {
             elem.updateTitle();
     },
 
-    attributesUpdated: function(nodeId, attrsArray)
+    _attributesUpdated: function(nodeId, attrsArray)
     {
         var node = this._idToDOMNode[nodeId];
         node._setAttributesPayload(attrsArray);
@@ -359,7 +359,7 @@ WebInspector.DOMAgent.prototype = {
         this.document._fireDomEvent("DOMAttrModified", event);
     },
 
-    characterDataModified: function(nodeId, newValue)
+    _characterDataModified: function(nodeId, newValue)
     {
         var node = this._idToDOMNode[nodeId];
         node._nodeValue = newValue;
@@ -373,13 +373,13 @@ WebInspector.DOMAgent.prototype = {
         return this._idToDOMNode[nodeId];
     },
 
-    didCommitLoad: function()
+    _didCommitLoad: function()
     {
         // Cleanup elements panel early on inspected page refresh.
-        this.setDocument(null);
+        this._setDocument(null);
     },
 
-    setDocument: function(payload)
+    _setDocument: function(payload)
     {
         this._idToDOMNode = {};
         if (payload && "id" in payload) {
@@ -392,13 +392,13 @@ WebInspector.DOMAgent.prototype = {
         WebInspector.panels.elements.setDocument(this.document);
     },
 
-    setDetachedRoot: function(payload)
+    _setDetachedRoot: function(payload)
     {
         var root = new WebInspector.DOMNode(this.document, payload);
         this._idToDOMNode[payload.id] = root;
     },
 
-    setChildNodes: function(parentId, payloads)
+    _setChildNodes: function(parentId, payloads)
     {
         var parent = this._idToDOMNode[parentId];
         parent._setChildrenPayload(payloads);
@@ -415,7 +415,7 @@ WebInspector.DOMAgent.prototype = {
         }
     },
 
-    childNodeCountUpdated: function(nodeId, newValue)
+    _childNodeCountUpdated: function(nodeId, newValue)
     {
         var node = this._idToDOMNode[nodeId];
         node._childNodeCount = newValue;
@@ -425,7 +425,7 @@ WebInspector.DOMAgent.prototype = {
             treeElement.hasChildren = newValue;
     },
 
-    childNodeInserted: function(parentId, prevId, payload)
+    _childNodeInserted: function(parentId, prevId, payload)
     {
         var parent = this._idToDOMNode[parentId];
         var prev = this._idToDOMNode[prevId];
@@ -435,7 +435,7 @@ WebInspector.DOMAgent.prototype = {
         this.document._fireDomEvent("DOMNodeInserted", event);
     },
 
-    childNodeRemoved: function(parentId, nodeId)
+    _childNodeRemoved: function(parentId, nodeId)
     {
         var parent = this._idToDOMNode[parentId];
         var node = this._idToDOMNode[nodeId];
@@ -457,31 +457,87 @@ WebInspector.DOMAgent.prototype = {
     }
 }
 
-WebInspector.ApplicationCache = {}
-
-WebInspector.ApplicationCache.getApplicationCachesAsync = function(callback)
+WebInspector.DOMDispatcher = function(domAgent)
 {
-    function mycallback(applicationCaches)
+    this._domAgent = domAgent;
+}
+
+WebInspector.DOMDispatcher.prototype = {
+    setDocument: function(payload)
     {
-        // FIXME: Currently, this list only returns a single application cache.
-        if (applicationCaches)
-            callback(applicationCaches);
-    }
+        this._domAgent._setDocument(payload);
+    },
+
+    attributesUpdated: function(nodeId, attrsArray)
+    {
+        this._domAgent._attributesUpdated(nodeId, attrsArray);
+    },
+
+    characterDataModified: function(nodeId, newValue)
+    {
+        this._domAgent._characterDataModified(nodeId, newValue);
+    },
 
-    InspectorBackend.getApplicationCaches(mycallback);
+    setChildNodes: function(parentId, payloads)
+    {
+        this._domAgent._setChildNodes(parentId, payloads);
+    },
+
+    setDetachedRoot: function(payload)
+    {
+        this._domAgent._setDetachedRoot(payload);
+    },
+
+    childNodeCountUpdated: function(nodeId, newValue)
+    {
+        this._domAgent._childNodeCountUpdated(nodeId, newValue);
+    },
+
+    childNodeInserted: function(parentId, prevId, payload)
+    {
+        this._domAgent._childNodeInserted(parentId, prevId, payload);
+    },
+
+    childNodeRemoved: function(parentId, nodeId)
+    {
+        this._domAgent._childNodeRemoved(parentId, nodeId);
+    },
+
+    didCommitLoad: function()
+    {
+        this._domAgent._didCommitLoad();
+    }
 }
 
-WebInspector.ApplicationCache.updateApplicationCacheStatus = function(status)
+WebInspector.ApplicationCacheDispatcher = function()
 {
-    WebInspector.panels.resources.updateApplicationCacheStatus(status);
 }
 
-WebInspector.ApplicationCache.updateNetworkState = function(isNowOnline)
-{
-    WebInspector.panels.resources.updateNetworkState(isNowOnline);
+WebInspector.ApplicationCacheDispatcher.prototype = {
+    getApplicationCachesAsync: function(callback)
+    {
+        function mycallback(applicationCaches)
+        {
+            // FIXME: Currently, this list only returns a single application cache.
+            if (applicationCaches)
+                callback(applicationCaches);
+        }
+    
+        InspectorBackend.getApplicationCaches(mycallback);
+    },
+        
+    updateApplicationCacheStatus: function(status)
+    {
+        WebInspector.panels.resources.updateApplicationCacheStatus(status);
+    },
+
+    updateNetworkState: function(isNowOnline)
+    {
+        WebInspector.panels.resources.updateNetworkState(isNowOnline);
+    }
 }
 
-InspectorBackend.registerDomainDispatcher("ApplicationCache", WebInspector.ApplicationCache);
+InspectorBackend.registerDomainDispatcher("ApplicationCache", new WebInspector.ApplicationCacheDispatcher());
 
 WebInspector.Cookies = {}
 
diff --git a/Source/WebCore/inspector/front-end/DOMStorage.js b/Source/WebCore/inspector/front-end/DOMStorage.js
index aa14a9c..d3d2226 100644
--- a/Source/WebCore/inspector/front-end/DOMStorage.js
+++ b/Source/WebCore/inspector/front-end/DOMStorage.js
@@ -70,26 +70,33 @@ WebInspector.DOMStorage.prototype = {
     }
 }
 
-WebInspector.DOMStorage.addDOMStorage = function(payload)
-{
-    if (!WebInspector.panels.resources)
-        return;
-    var domStorage = new WebInspector.DOMStorage(
-        payload.id,
-        payload.host,
-        payload.isLocalStorage);
-    WebInspector.panels.resources.addDOMStorage(domStorage);
-}
 
-WebInspector.DOMStorage.selectDOMStorage = function(o)
+WebInspector.DOMStorageDispatcher = function()
 {
-    WebInspector.showPanel("resources");
-    WebInspector.panels.resources.selectDOMStorage(o);
 }
 
-WebInspector.DOMStorage.updateDOMStorage = function(storageId)
-{
-    WebInspector.panels.resources.updateDOMStorage(storageId);
+WebInspector.DOMStorageDispatcher.prototype = {
+    addDOMStorage: function(payload)
+    {
+        if (!WebInspector.panels.resources)
+            return;
+        var domStorage = new WebInspector.DOMStorage(
+            payload.id,
+            payload.host,
+            payload.isLocalStorage);
+        WebInspector.panels.resources.addDOMStorage(domStorage);
+    },
+
+    selectDOMStorage: function(o)
+    {
+        WebInspector.showPanel("resources");
+        WebInspector.panels.resources.selectDOMStorage(o);
+    },
+
+    updateDOMStorage: function(storageId)
+    {
+        WebInspector.panels.resources.updateDOMStorage(storageId);
+    }
 }
 
-InspectorBackend.registerDomainDispatcher("DOMStorage", WebInspector.DOMStorage);
+InspectorBackend.registerDomainDispatcher("DOMStorage", new WebInspector.DOMStorageDispatcher());
diff --git a/Source/WebCore/inspector/front-end/Database.js b/Source/WebCore/inspector/front-end/Database.js
index 0b00330..faa17fa 100644
--- a/Source/WebCore/inspector/front-end/Database.js
+++ b/Source/WebCore/inspector/front-end/Database.js
@@ -34,8 +34,6 @@ WebInspector.Database = function(id, domain, name, version)
     this._version = version;
 }
 
-WebInspector.Database._callbacks = {};
-
 WebInspector.Database.prototype = {
     get id()
     {
@@ -94,50 +92,58 @@ WebInspector.Database.prototype = {
                 onError(WebInspector.UIString("Database not found."));
                 return;
             }
-            WebInspector.Database._callbacks[transactionId] = {"onSuccess": onSuccess, "onError": onError};
+            WebInspector.DatabaseDispatcher._callbacks[transactionId] = {"onSuccess": onSuccess, "onError": onError};
         }
         InspectorBackend.executeSQL(this._id, query, callback);
     }
 }
 
-WebInspector.Database.addDatabase = function(payload)
+WebInspector.DatabaseDispatcher = function()
 {
-    if (!WebInspector.panels.resources)
-        return;
-    var database = new WebInspector.Database(
-        payload.id,
-        payload.domain,
-        payload.name,
-        payload.version);
-    WebInspector.panels.resources.addDatabase(database);
 }
 
-WebInspector.Database.selectDatabase = function(o)
-{
-    WebInspector.showPanel("resources");
-    WebInspector.panels.resources.selectDatabase(o);
-}
+WebInspector.DatabaseDispatcher._callbacks = {};
 
-WebInspector.Database.sqlTransactionSucceeded = function(transactionId, columnNames, values)
-{
-    if (!WebInspector.Database._callbacks[transactionId])
-        return;
+WebInspector.DatabaseDispatcher.prototype = {
+    addDatabase: function(payload)
+    {
+        if (!WebInspector.panels.resources)
+            return;
+        var database = new WebInspector.Database(
+            payload.id,
+            payload.domain,
+            payload.name,
+            payload.version);
+        WebInspector.panels.resources.addDatabase(database);
+    },
 
-    var callback = WebInspector.Database._callbacks[transactionId].onSuccess;
-    delete WebInspector.Database._callbacks[transactionId];
-    if (callback)
-        callback(columnNames, values);
-}
+    selectDatabase: function(o)
+    {
+        WebInspector.showPanel("resources");
+        WebInspector.panels.resources.selectDatabase(o);
+    },
 
-WebInspector.Database.sqlTransactionFailed = function(transactionId, errorObj)
-{
-    if (!WebInspector.Database._callbacks[transactionId])
-        return;
+    sqlTransactionSucceeded: function(transactionId, columnNames, values)
+    {
+        if (!WebInspector.DatabaseDispatcher._callbacks[transactionId])
+            return;
+    
+        var callback = WebInspector.DatabaseDispatcher._callbacks[transactionId].onSuccess;
+        delete WebInspector.DatabaseDispatcher._callbacks[transactionId];
+        if (callback)
+            callback(columnNames, values);
+    },
+
+    sqlTransactionFailed: function(transactionId, errorObj)
+    {
+        if (!WebInspector.DatabaseDispatcher._callbacks[transactionId])
+            return;
 
-    var callback = WebInspector.Database._callbacks[transactionId].onError;
-    delete WebInspector.Database._callbacks[transactionId];
-    if (callback)
-        callback(errorObj);
+        var callback = WebInspector.DatabaseDispatcher._callbacks[transactionId].onError;
+        delete WebInspector.DatabaseDispatcher._callbacks[transactionId];
+        if (callback)
+             callback(errorObj);
+    }
 }
 
-InspectorBackend.registerDomainDispatcher("Database", WebInspector.Database);
+InspectorBackend.registerDomainDispatcher("Database", new WebInspector.DatabaseDispatcher());
diff --git a/Source/WebCore/inspector/front-end/DebuggerModel.js b/Source/WebCore/inspector/front-end/DebuggerModel.js
index 5ab0e2d..a1762cd 100644
--- a/Source/WebCore/inspector/front-end/DebuggerModel.js
+++ b/Source/WebCore/inspector/front-end/DebuggerModel.js
@@ -30,12 +30,12 @@
 
 WebInspector.DebuggerModel = function()
 {
-    InspectorBackend.registerDomainDispatcher("Debugger", this);
-
     this._paused = false;
     this._breakpoints = {};
     this._sourceIDAndLineToBreakpointId = {};
     this._scripts = {};
+
+    InspectorBackend.registerDomainDispatcher("Debugger", new WebInspector.DebuggerDispatcher(this));
 }
 
 WebInspector.DebuggerModel.Events = {
@@ -161,9 +161,7 @@ WebInspector.DebuggerModel.prototype = {
         return scripts;
     },
 
-    // All the methods below are InspectorBackend notification handlers.
-
-    pausedScript: function(details)
+    _pausedScript: function(details)
     {
         this._paused = true;
         if ("_continueToLineBreakpointId" in this) {
@@ -182,7 +180,7 @@ WebInspector.DebuggerModel.prototype = {
         this._lastHitBreakpoint = breakpoint;
     },
 
-    resumedScript: function()
+    _resumedScript: function()
     {
         this._paused = false;
         this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.DebuggerResumed);
@@ -193,6 +191,44 @@ WebInspector.DebuggerModel.prototype = {
         delete this._lastHitBreakpoint;
     },
 
+    _parsedScriptSource: function(sourceID, sourceURL, source, startingLine, scriptWorldType)
+    {
+        var script = new WebInspector.Script(sourceID, sourceURL, source, startingLine, undefined, undefined, scriptWorldType);
+        this._scripts[sourceID] = script;
+        this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.ParsedScriptSource, sourceID);
+    },
+
+    _failedToParseScriptSource: function(sourceURL, source, startingLine, errorLine, errorMessage)
+    {
+        var script = new WebInspector.Script(null, sourceURL, source, startingLine, errorLine, errorMessage, undefined);
+        this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.FailedToParseScriptSource, script);
+    }
+}
+
+WebInspector.DebuggerModel.prototype.__proto__ = WebInspector.Object.prototype;
+
+WebInspector.DebuggerEventTypes = {
+    JavaScriptPause: 0,
+    JavaScriptBreakpoint: 1,
+    NativeBreakpoint: 2
+};
+
+WebInspector.DebuggerDispatcher = function(debuggerModel)
+{
+    this._debuggerModel = debuggerModel;
+}
+
+WebInspector.DebuggerDispatcher.prototype = {
+    pausedScript: function(details)
+    {
+        this._debuggerModel._pausedScript(details);
+    },
+
+    resumedScript: function()
+    {
+        this._debuggerModel._resumedScript();
+    },
+
     attachDebuggerWhenShown: function()
     {
         WebInspector.panels.scripts.attachDebuggerWhenShown();
@@ -210,15 +246,12 @@ WebInspector.DebuggerModel.prototype = {
 
     parsedScriptSource: function(sourceID, sourceURL, source, startingLine, scriptWorldType)
     {
-        var script = new WebInspector.Script(sourceID, sourceURL, source, startingLine, undefined, undefined, scriptWorldType);
-        this._scripts[sourceID] = script;
-        this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.ParsedScriptSource, sourceID);
+        this._debuggerModel._parsedScriptSource(sourceID, sourceURL, source, startingLine, scriptWorldType);
     },
 
     failedToParseScriptSource: function(sourceURL, source, startingLine, errorLine, errorMessage)
     {
-        var script = new WebInspector.Script(null, sourceURL, source, startingLine, errorLine, errorMessage, undefined);
-        this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.FailedToParseScriptSource, script);
+        this._debuggerModel._failedToParseScriptSource(sourceURL, source, startingLine, errorLine, errorMessage);
     },
 
     didCreateWorker: function()
@@ -233,11 +266,3 @@ WebInspector.DebuggerModel.prototype = {
         workersPane.removeWorker.apply(workersPane, arguments);
     }
 }
-
-WebInspector.DebuggerModel.prototype.__proto__ = WebInspector.Object.prototype;
-
-WebInspector.DebuggerEventTypes = {
-    JavaScriptPause: 0,
-    JavaScriptBreakpoint: 1,
-    NativeBreakpoint: 2
-};
diff --git a/Source/WebCore/inspector/front-end/FileSystemView.js b/Source/WebCore/inspector/front-end/FileSystemView.js
index 14ecf46..56f21a4 100644
--- a/Source/WebCore/inspector/front-end/FileSystemView.js
+++ b/Source/WebCore/inspector/front-end/FileSystemView.js
@@ -28,34 +28,38 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-WebInspector.FileSystem = {}
+WebInspector.FileSystemDispatcher = function()
+{
+}
 
 // Keep in sync with Type in AsyncFileSystem.h
-WebInspector.FileSystem.TEMPORARY = 0;
-WebInspector.FileSystem.PERSISTENT = 1;
+WebInspector.FileSystemDispatcher.TEMPORARY = 0;
+WebInspector.FileSystemDispatcher.PERSISTENT = 1;
 
-WebInspector.FileSystem.getFileSystemPathsAsync = function(origin)
-{
-    InspectorBackend.getFileSystemPathAsync(WebInspector.FileSystem.PERSISTENT, origin);
-    InspectorBackend.getFileSystemPathAsync(WebInspector.FileSystem.TEMPORARY, origin);
-}
+WebInspector.FileSystemDispatcher.prototype = {
+    getFileSystemPathsAsync: function(origin)
+    {
+        InspectorBackend.getFileSystemPathAsync(WebInspector.FileSystemDispatcher.PERSISTENT, origin);
+        InspectorBackend.getFileSystemPathAsync(WebInspector.FileSystemDispatcher.TEMPORARY, origin);
+    },
 
-WebInspector.FileSystem.didGetFileSystemPath = function(root, type, origin)
-{
-    WebInspector.panels.resources.updateFileSystemPath(root, type, origin);
-}
+    didGetFileSystemPath: function(root, type, origin)
+    {
+        WebInspector.panels.resources.updateFileSystemPath(root, type, origin);
+    },
 
-WebInspector.FileSystem.didGetFileSystemError = function(type, origin)
-{
-    WebInspector.panels.resources.updateFileSystemError(type, origin);
-}
+    didGetFileSystemError: function(type, origin)
+    {
+        WebInspector.panels.resources.updateFileSystemError(type, origin);
+    },
 
-WebInspector.FileSystem.didGetFileSystemDisabled = function()
-{
-    WebInspector.panels.resources.setFileSystemDisabled();
+    didGetFileSystemDisabled: function()
+    {
+        WebInspector.panels.resources.setFileSystemDisabled();
+    }
 }
 
-InspectorBackend.registerDomainDispatcher("FileSystem", WebInspector.FileSystem);
+InspectorBackend.registerDomainDispatcher("FileSystem", new WebInspector.FileSystemDispatcher());
 
 WebInspector.FileSystemView = function(treeElement, fileSystemOrigin)
 {
diff --git a/Source/WebCore/inspector/front-end/ProfilesPanel.js b/Source/WebCore/inspector/front-end/ProfilesPanel.js
index 65fc15e..2e0ab28 100644
--- a/Source/WebCore/inspector/front-end/ProfilesPanel.js
+++ b/Source/WebCore/inspector/front-end/ProfilesPanel.js
@@ -124,7 +124,7 @@ WebInspector.ProfilesPanel = function()
     this._profiles = [];
     this._profilerEnabled = Preferences.profilerAlwaysEnabled;
     this._reset();
-    InspectorBackend.registerDomainDispatcher("Profiler", this);
+    InspectorBackend.registerDomainDispatcher("Profiler", new WebInspector.ProfilerDispatcher(this));
 }
 
 WebInspector.ProfilesPanel.prototype = {
@@ -162,7 +162,7 @@ WebInspector.ProfilesPanel.prototype = {
         this._populateProfiles();
     },
 
-    profilerWasEnabled: function()
+    _profilerWasEnabled: function()
     {
         if (this._profilerEnabled)
             return;
@@ -174,7 +174,7 @@ WebInspector.ProfilesPanel.prototype = {
             this._populateProfiles();
     },
 
-    profilerWasDisabled: function()
+    _profilerWasDisabled: function()
     {
         if (!this._profilerEnabled)
             return;
@@ -183,11 +183,6 @@ WebInspector.ProfilesPanel.prototype = {
         this._reset();
     },
 
-    resetProfiles: function()
-    {
-        this._reset();
-    },
-
     _reset: function()
     {
         for (var i = 0; i < this._profiles.length; ++i)
@@ -262,7 +257,7 @@ WebInspector.ProfilesPanel.prototype = {
         return escape(text) + '/' + escape(profileTypeId);
     },
 
-    addProfileHeader: function(profile)
+    _addProfileHeader: function(profile)
     {
         var typeId = profile.typeId;
         var profileType = this.getProfileType(typeId);
@@ -327,7 +322,7 @@ WebInspector.ProfilesPanel.prototype = {
         }
     },
 
-    removeProfileHeader: function(profile)
+    _removeProfileHeader: function(profile)
     {
         var typeId = profile.typeId;
         var profileType = this.getProfileType(typeId);
@@ -432,7 +427,7 @@ WebInspector.ProfilesPanel.prototype = {
         }
     },
 
-    addHeapSnapshotChunk: function(uid, chunk)
+    _addHeapSnapshotChunk: function(uid, chunk)
     {
         var profile = this._profilesIdMap[this._makeKey(uid, WebInspector.HeapSnapshotProfileType.TypeId)];
         if (!profile || profile._loaded || !profile._is_loading)
@@ -441,7 +436,7 @@ WebInspector.ProfilesPanel.prototype = {
         profile._json += chunk;
     },
 
-    finishHeapSnapshot: function(uid)
+    _finishHeapSnapshot: function(uid)
     {
         var profile = this._profilesIdMap[this._makeKey(uid, WebInspector.HeapSnapshotProfileType.TypeId)];
         if (!profile || profile._loaded || !profile._is_loading)
@@ -600,7 +595,7 @@ WebInspector.ProfilesPanel.prototype = {
             var profileHeadersLength = profileHeaders.length;
             for (var i = 0; i < profileHeadersLength; ++i)
                 if (!this.hasProfile(profileHeaders[i]))
-                    WebInspector.panels.profiles.addProfileHeader(profileHeaders[i]);
+                   this._addProfileHeader(profileHeaders[i]);
         }
 
         InspectorBackend.getProfileHeaders(populateCallback.bind(this));
@@ -616,7 +611,7 @@ WebInspector.ProfilesPanel.prototype = {
         this.resize();
     },
 
-    setRecordingProfile: function(isProfiling)
+    _setRecordingProfile: function(isProfiling)
     {
         this.getProfileType(WebInspector.CPUProfileType.TypeId).setRecordingProfile(isProfiling);
         if (this.hasTemporaryProfile(WebInspector.CPUProfileType.TypeId) !== isProfiling) {
@@ -629,9 +624,9 @@ WebInspector.ProfilesPanel.prototype = {
                 };
             }
             if (isProfiling)
-                this.addProfileHeader(this._temporaryRecordingProfile);
+                this._addProfileHeader(this._temporaryRecordingProfile);
             else
-                this.removeProfileHeader(this._temporaryRecordingProfile);
+                this._removeProfileHeader(this._temporaryRecordingProfile);
         }
         this.updateProfileTypeButtons();
     }
@@ -639,6 +634,49 @@ WebInspector.ProfilesPanel.prototype = {
 
 WebInspector.ProfilesPanel.prototype.__proto__ = WebInspector.Panel.prototype;
 
+
+WebInspector.ProfilerDispatcher = function(profiler)
+{
+    this._profiler = profiler;
+}
+
+WebInspector.ProfilerDispatcher.prototype = {
+    profilerWasEnabled: function()
+    {
+        this._profiler._profilerWasEnabled();
+    },
+
+    profilerWasDisabled: function()
+    {
+        this._profiler._profilerWasDisabled();
+    },
+
+    resetProfiles: function()
+    {
+        this._profiler._reset();
+    },
+
+    addProfileHeader: function(profile)
+    {
+        this._profiler._addProfileHeader(profile);
+    },
+
+    addHeapSnapshotChunk: function(uid, chunk)
+    {
+        this._profiler._addHeapSnapshotChunk(uid, chunk);
+    },
+
+    finishHeapSnapshot: function(uid)
+    {
+        this._profiler._finishHeapSnapshot(uid);
+    },
+
+    setRecordingProfile: function(isProfiling)
+    {
+        this._profiler._setRecordingProfile(isProfiling);
+    }
+}
+
 WebInspector.ProfileSidebarTreeElement = function(profile, titleFormat, className)
 {
     this.profile = profile;
@@ -660,7 +698,7 @@ WebInspector.ProfileSidebarTreeElement.prototype = {
 
     ondelete: function()
     {
-        this.treeOutline.panel.removeProfileHeader(this.profile);
+        this.treeOutline.panel._removeProfileHeader(this.profile);
         return true;
     },
 
@@ -720,4 +758,3 @@ WebInspector.ProfileGroupSidebarTreeElement.prototype = {
 }
 
 WebInspector.ProfileGroupSidebarTreeElement.prototype.__proto__ = WebInspector.SidebarTreeElement.prototype;
-
diff --git a/Source/WebCore/inspector/front-end/ResourceTreeModel.js b/Source/WebCore/inspector/front-end/ResourceTreeModel.js
index eef2dc1..6f6ba7a 100644
--- a/Source/WebCore/inspector/front-end/ResourceTreeModel.js
+++ b/Source/WebCore/inspector/front-end/ResourceTreeModel.js
@@ -34,7 +34,6 @@ WebInspector.ResourceTreeModel = function()
     this._resourcesByURL = {};
     this._resourcesByFrameId = {};
     this._subframes = {};
-    InspectorBackend.registerDomainDispatcher("Resources", this);
     InspectorBackend.cachedResources(this._processCachedResources.bind(this));
 }
 
diff --git a/Source/WebCore/inspector/front-end/TimelinePanel.js b/Source/WebCore/inspector/front-end/TimelinePanel.js
index 7206d81..1d8b9c9 100644
--- a/Source/WebCore/inspector/front-end/TimelinePanel.js
+++ b/Source/WebCore/inspector/front-end/TimelinePanel.js
@@ -99,7 +99,7 @@ WebInspector.TimelinePanel = function()
     this._markTimelineRecords = [];
     this._expandOffset = 15;
 
-    InspectorBackend.registerDomainDispatcher("Timeline", this);
+    InspectorBackend.registerDomainDispatcher("Timeline", new WebInspector.TimelineDispatcher(this));
 }
 
 // Define row height, should be in sync with styles for timeline graphs.
@@ -285,17 +285,17 @@ WebInspector.TimelinePanel.prototype = {
         this._scheduleRefresh(true);
     },
 
-    timelineProfilerWasStarted: function()
+    _timelineProfilerWasStarted: function()
     {
         this.toggleTimelineButton.toggled = true;
     },
 
-    timelineProfilerWasStopped: function()
+    _timelineProfilerWasStopped: function()
     {
         this.toggleTimelineButton.toggled = false;
     },
 
-    addRecordToTimeline: function(record)
+    _addRecordToTimeline: function(record)
     {
         if (record.type == WebInspector.TimelineAgent.RecordType.ResourceSendRequest) {
             var isMainResource = (record.data.identifier === WebInspector.mainResource.identifier);
@@ -643,6 +643,28 @@ WebInspector.TimelinePanel.prototype = {
 
 WebInspector.TimelinePanel.prototype.__proto__ = WebInspector.Panel.prototype;
 
+WebInspector.TimelineDispatcher = function(timelinePanel)
+{
+    this._timelinePanel = timelinePanel;
+}
+
+WebInspector.TimelineDispatcher.prototype = {
+    timelineProfilerWasStarted: function()
+    {
+        this._timelinePanel._timelineProfilerWasStarted();
+    },
+
+    timelineProfilerWasStopped: function()
+    {
+        this._timelinePanel._timelineProfilerWasStopped();
+    },
+
+    addRecordToTimeline: function(record)
+    {
+        this._timelinePanel._addRecordToTimeline(record);
+    }
+}
+
 WebInspector.TimelineCategory = function(name, title, color)
 {
     this.name = name;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list