Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(793)

Unified Diff: third_party/WebKit/Source/devtools/front_end/worker_service/ServiceDispatcher.js

Issue 2417703006: DevTools: introduce a stub for the new audits panel (behind experiment). (Closed)
Patch Set: missing file added. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/services/ServiceManager.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/worker_service/ServiceDispatcher.js
diff --git a/third_party/WebKit/Source/devtools/front_end/worker_service/ServiceDispatcher.js b/third_party/WebKit/Source/devtools/front_end/worker_service/ServiceDispatcher.js
index 5512e77ffca6674c6b99b2751b140999d6b3aaa6..fe4ff440426e7f92706798151ad600cd8c72b3ae 100644
--- a/third_party/WebKit/Source/devtools/front_end/worker_service/ServiceDispatcher.js
+++ b/third_party/WebKit/Source/devtools/front_end/worker_service/ServiceDispatcher.js
@@ -140,7 +140,7 @@ ServiceDispatcher.prototype = {
/**
* @constructor
- * @param {!Port} port
+ * @param {!Port|!Worker} port
* @implements {ServicePort}
*/
function WorkerServicePort(port)
@@ -200,6 +200,22 @@ var services = new Map();
* @param {string} serviceName
* @param {function(new:Service)} constructor
*/
+function initializeWorkerService(serviceName, constructor)
+{
+ services.set(serviceName, constructor);
+ if (!dispatchers.length) {
+ var worker = /** @type {!Object} */(self);
+ var servicePort = new WorkerServicePort(/** @type {!Worker} */(worker));
+ var dispatcher = new ServiceDispatcher(servicePort);
+ dispatchers.push(dispatcher);
+ }
+ dispatchers[0].registerObject(serviceName, constructor);
+}
+
+/**
+ * @param {string} serviceName
+ * @param {function(new:Service)} constructor
+ */
function initializeSharedWorkerService(serviceName, constructor)
{
services.set(serviceName, constructor);
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/services/ServiceManager.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698