Web Inspector: bind registerDomainDispatcher to domain names.
authorloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 Aug 2011 15:36:28 +0000 (15:36 +0000)
committerloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 Aug 2011 15:36:28 +0000 (15:36 +0000)
https://bugs.webkit.org/show_bug.cgi?id=66670

jscompiler can't be used for validating domain events dispatchers because registerDomainDispatcher is too generic.
I'd like to introduce named versions per each domain.

Reviewed by Pavel Feldman.

* inspector/CodeGeneratorInspector.pm:
(GenerateInterface):
(generateBackendStubJS):
* inspector/front-end/ApplicationCacheItemsView.js:
* inspector/front-end/ConsoleView.js:
* inspector/front-end/DOMAgent.js:
(WebInspector.DOMAgent):
* inspector/front-end/DOMStorage.js:
* inspector/front-end/Database.js:
* inspector/front-end/DebuggerModel.js:
(WebInspector.DebuggerModel):
* inspector/front-end/NetworkManager.js:
(WebInspector.NetworkDispatcher):
* inspector/front-end/ProfilesPanel.js:
* inspector/front-end/ResourceTreeModel.js:
(WebInspector.ResourceTreeModel):
* inspector/front-end/TimelineManager.js:
(WebInspector.TimelineDispatcher):
* inspector/front-end/WorkerManager.js:
(WebInspector.WorkerManager):
* inspector/front-end/inspector.js:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@93510 268f45cc-cd09-0410-ab3c-d52691b4dbfc

14 files changed:
Source/WebCore/ChangeLog
Source/WebCore/inspector/CodeGeneratorInspector.pm
Source/WebCore/inspector/front-end/ApplicationCacheItemsView.js
Source/WebCore/inspector/front-end/ConsoleView.js
Source/WebCore/inspector/front-end/DOMAgent.js
Source/WebCore/inspector/front-end/DOMStorage.js
Source/WebCore/inspector/front-end/Database.js
Source/WebCore/inspector/front-end/DebuggerModel.js
Source/WebCore/inspector/front-end/NetworkManager.js
Source/WebCore/inspector/front-end/ProfilesPanel.js
Source/WebCore/inspector/front-end/ResourceTreeModel.js
Source/WebCore/inspector/front-end/TimelineManager.js
Source/WebCore/inspector/front-end/WorkerManager.js
Source/WebCore/inspector/front-end/inspector.js

index 8d14842fe2a2cda4b194a1fad5e036a2c2c07053..e3156bb161b165fb7104e4b6c83614caaf67133f 100755 (executable)
@@ -1,3 +1,35 @@
+2011-08-22  Ilya Tikhonovsky  <loislo@chromium.org>
+
+        Web Inspector: bind registerDomainDispatcher to domain names.
+        https://bugs.webkit.org/show_bug.cgi?id=66670
+
+        jscompiler can't be used for validating domain events dispatchers because registerDomainDispatcher is too generic.
+        I'd like to introduce named versions per each domain.
+
+        Reviewed by Pavel Feldman.
+
+        * inspector/CodeGeneratorInspector.pm:
+        (GenerateInterface):
+        (generateBackendStubJS):
+        * inspector/front-end/ApplicationCacheItemsView.js:
+        * inspector/front-end/ConsoleView.js:
+        * inspector/front-end/DOMAgent.js:
+        (WebInspector.DOMAgent):
+        * inspector/front-end/DOMStorage.js:
+        * inspector/front-end/Database.js:
+        * inspector/front-end/DebuggerModel.js:
+        (WebInspector.DebuggerModel):
+        * inspector/front-end/NetworkManager.js:
+        (WebInspector.NetworkDispatcher):
+        * inspector/front-end/ProfilesPanel.js:
+        * inspector/front-end/ResourceTreeModel.js:
+        (WebInspector.ResourceTreeModel):
+        * inspector/front-end/TimelineManager.js:
+        (WebInspector.TimelineDispatcher):
+        * inspector/front-end/WorkerManager.js:
+        (WebInspector.WorkerManager):
+        * inspector/front-end/inspector.js:
+
 2011-08-22  Benjamin Poulain  <benjamin@webkit.org>
 
         Fix generate-inspector-idl for Python3 after r93396
index 1a811a6367fe12813e0f27a7748bc5ad395741c8..b1b9469c09e092f11115b98cc49c9dca12708da8 100644 (file)
@@ -245,6 +245,7 @@ my $frontendConstructor;
 my @frontendConstantDeclarations;
 my @frontendConstantDefinitions;
 my @frontendFooter;
+my @frontendDomains;
 
 # Default constructor
 sub new
@@ -304,6 +305,7 @@ sub GenerateInterface
     );
     generateFunctions($interface, \%agent);
     if (@{$agent{methodDeclarations}}) {
+        push(@frontendDomains, $interface->name);
         generateAgentDeclaration($interface, \%agent);
     }
 }
@@ -755,6 +757,7 @@ sub collectBackendJSStubEvents
 
 sub generateBackendStubJS
 {
+    my $JSRegisterDomainDispatchers = join("\n", map("    this.register" . $_ . "Dispatcher = this._registerDomainDispatcher.bind(this, \"" . $_ ."\");", @frontendDomains));
     my $JSStubs = join("\n", @backendJSStubs);
     my $JSEvents = join("\n", @backendJSEvents);
     my $inspectorBackendStubJS = << "EOF";
@@ -769,6 +772,7 @@ InspectorBackendStub = function()
     this._eventArgs = {};
 $JSStubs
 $JSEvents
+$JSRegisterDomainDispatchers
 }
 
 InspectorBackendStub.prototype = {
@@ -854,7 +858,7 @@ InspectorBackendStub.prototype = {
         InspectorFrontendHost.sendMessageToBackend(message);
     },
 
-    registerDomainDispatcher: function(domain, dispatcher)
+    _registerDomainDispatcher: function(domain, dispatcher)
     {
         this._domainDispatchers[domain] = dispatcher;
     },
index 7a544931bb537d00a37f593cdf2b647f4be6001a..4a3e8ed1311fa25916a784c04ffa31a04af33dca 100644 (file)
@@ -308,4 +308,4 @@ WebInspector.ApplicationCacheDispatcher.prototype = {
     }
 }
 
-InspectorBackend.registerDomainDispatcher("ApplicationCache", new WebInspector.ApplicationCacheDispatcher());
+InspectorBackend.registerApplicationCacheDispatcher(new WebInspector.ApplicationCacheDispatcher());
index 9262e5cbb7c0bbc71b3ea1486eb90e0e9ce1f4ee..2e705ce09b1bd20b81d55f57711eb5f87ab27864 100644 (file)
@@ -157,7 +157,7 @@ WebInspector.ConsoleView.prototype = {
                     console.clearMessages();
             },
         }
-        InspectorBackend.registerDomainDispatcher("Console", dispatcher);
+        InspectorBackend.registerConsoleDispatcher(dispatcher);
     },
 
     setConsoleMessageExpiredCount: function(count)
index 7300371ab7702efb94f53e224864a44549cf3e09..5a58969c24f172a36af1f1d3e206acda26e47ff0 100644 (file)
@@ -336,7 +336,7 @@ WebInspector.DOMAgent = function() {
     this._idToDOMNode = null;
     this._document = null;
     this._attributeLoadNodeIds = {};
-    InspectorBackend.registerDomainDispatcher("DOM", new WebInspector.DOMDispatcher(this));
+    InspectorBackend.registerDOMDispatcher(new WebInspector.DOMDispatcher(this));
 }
 
 WebInspector.DOMAgent.Events = {
index 922d7295da1c4b44cc99ac271420de115f39b79b..a4d57d89e78fd796c3181068a44a57b7366b4949 100644 (file)
@@ -86,4 +86,4 @@ WebInspector.DOMStorageDispatcher.prototype = {
     }
 }
 
-InspectorBackend.registerDomainDispatcher("DOMStorage", new WebInspector.DOMStorageDispatcher());
+InspectorBackend.registerDOMStorageDispatcher(new WebInspector.DOMStorageDispatcher());
index 685c2888d315fd53fc4cb78f303a9c57297bc3c2..b5b14b66ddcef535c4573e2d64edf06e047fd08f 100644 (file)
@@ -143,4 +143,4 @@ WebInspector.DatabaseDispatcher.prototype = {
     }
 }
 
-InspectorBackend.registerDomainDispatcher("Database", new WebInspector.DatabaseDispatcher());
+InspectorBackend.registerDatabaseDispatcher(new WebInspector.DatabaseDispatcher());
index 1d97e6e1a2fe0d102ff9a690fa707b96873379ff..e7a246cc105e67b124b3561195722a6f1427bc60 100644 (file)
@@ -33,7 +33,7 @@ WebInspector.DebuggerModel = function()
     this._debuggerPausedDetails = {};
     this._scripts = {};
 
-    InspectorBackend.registerDomainDispatcher("Debugger", new WebInspector.DebuggerDispatcher(this));
+    InspectorBackend.registerDebuggerDispatcher(new WebInspector.DebuggerDispatcher(this));
 }
 
 WebInspector.DebuggerModel.Events = {
index 6a78e9dcadbcd3505ad93325ebc6c28cd230ebbf..1fc5e0307f2e9a01098d731e352604ec7d5102e5 100644 (file)
@@ -81,7 +81,7 @@ WebInspector.NetworkDispatcher = function(manager)
     this._manager = manager;
     this._inflightResourcesById = {};
     this._inflightResourcesByURL = {};
-    InspectorBackend.registerDomainDispatcher("Network", this);
+    InspectorBackend.registerNetworkDispatcher(this);
 }
 
 WebInspector.NetworkDispatcher.prototype = {
index b14d8fd2d1f0da0fd78e1beada9f7aa80a7c137d..07c24e35d21a9c485925da43e0d5707e6946e7ee 100644 (file)
@@ -129,7 +129,7 @@ WebInspector.ProfilesPanel = function()
     if (Preferences.heapProfilerPresent)
         this._registerProfileType(new WebInspector.DetailedHeapshotProfileType());
 
-    InspectorBackend.registerDomainDispatcher("Profiler", new WebInspector.ProfilerDispatcher(this));
+    InspectorBackend.registerProfilerDispatcher(new WebInspector.ProfilerDispatcher(this));
 
     if (Preferences.profilerAlwaysEnabled || WebInspector.settings.profilerEnabled.get())
         ProfilerAgent.enable();
index d36ad0b4fc3b0e623ccc4d355cc517d80233c444..0bc00e9cf70ae2fd19669c0eb82484b6991a0931 100644 (file)
@@ -39,7 +39,7 @@ WebInspector.ResourceTreeModel = function(networkManager)
     WebInspector.console.addEventListener(WebInspector.ConsoleView.Events.ConsoleCleared, this._consoleCleared, this);
 
     this.frontendReused();
-    InspectorBackend.registerDomainDispatcher("Page", new WebInspector.PageDispatcher(this));
+    InspectorBackend.registerPageDispatcher(new WebInspector.PageDispatcher(this));
     
     this._pendingConsoleMessages = {};
 }
index 192b557853a3a554e23d6e9796e9e557958b8708..0cae09b2d29ee10bd0ff882249cdea59cfdd22e4 100644 (file)
@@ -66,7 +66,7 @@ WebInspector.TimelineManager.prototype.__proto__ = WebInspector.Object.prototype
 WebInspector.TimelineDispatcher = function(manager)
 {
     this._manager = manager;
-    InspectorBackend.registerDomainDispatcher("Timeline", this);
+    InspectorBackend.registerTimelineDispatcher(this);
 }
 
 WebInspector.TimelineDispatcher.prototype = {
index f92327adeef1f518abeed7a2a066a527eb80b2d4..663ceb4484874fd53cf9a9dcc0fbb85fcd4c495b 100644 (file)
@@ -31,7 +31,7 @@
 WebInspector.WorkerManager = function()
 {
     this._workerIdToWindow = {};
-    InspectorBackend.registerDomainDispatcher("Worker", new WebInspector.DedicatedWorkerMessageForwarder(this));
+    InspectorBackend.registerWorkerDispatcher(new WebInspector.DedicatedWorkerMessageForwarder(this));
 }
 
 WebInspector.WorkerManager.isWorkerFrontend = function()
index 076800b87f7d2e421a91fb7d12a84577fbb8e41a..d63e009b3c5b170313b19fba37d640e1496e7eee 100644 (file)
@@ -503,7 +503,7 @@ WebInspector.doLoadedDone = function()
     this.domAgent = new WebInspector.DOMAgent();
     new WebInspector.JavaScriptContextManager(this.resourceTreeModel, this.console);
 
-    InspectorBackend.registerDomainDispatcher("Inspector", this);
+    InspectorBackend.registerInspectorDispatcher(this);
 
     this.resourceCategories = {
         documents: new WebInspector.ResourceCategory("documents", WebInspector.UIString("Documents"), "rgb(47,102,236)"),