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

Unified Diff: third_party/WebKit/Source/devtools/front_end/protocol/InspectorBackend.js

Issue 2672983002: [DevTools] Separate ScreenCaptureModel out of ResourceTreeModel. (Closed)
Patch Set: Created 3 years, 11 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
Index: third_party/WebKit/Source/devtools/front_end/protocol/InspectorBackend.js
diff --git a/third_party/WebKit/Source/devtools/front_end/protocol/InspectorBackend.js b/third_party/WebKit/Source/devtools/front_end/protocol/InspectorBackend.js
index 3c01fe964b7e0c01ff7d14d5ca99c52d340ad991..293e2ab31d1bc45594ea70d0ac7837e476be3151 100644
--- a/third_party/WebKit/Source/devtools/front_end/protocol/InspectorBackend.js
+++ b/third_party/WebKit/Source/devtools/front_end/protocol/InspectorBackend.js
@@ -378,7 +378,7 @@ Protocol.TargetBase = class {
if (!this._dispatchers[domain])
return;
- this._dispatchers[domain].setDomainDispatcher(dispatcher);
+ this._dispatchers[domain].addDomainDispatcher(dispatcher);
}
/**
@@ -663,7 +663,7 @@ Protocol.InspectorBackend._AgentPrototype = class {
Protocol.InspectorBackend._DispatcherPrototype = class {
constructor() {
this._eventArgs = {};
- this._dispatcher = null;
+ this._dispatchers = [];
}
/**
@@ -677,8 +677,8 @@ Protocol.InspectorBackend._DispatcherPrototype = class {
/**
* @param {!Object} dispatcher
*/
- setDomainDispatcher(dispatcher) {
- this._dispatcher = dispatcher;
+ addDomainDispatcher(dispatcher) {
+ this._dispatchers.push(dispatcher);
}
/**
@@ -686,10 +686,10 @@ Protocol.InspectorBackend._DispatcherPrototype = class {
* @param {!Object} messageObject
*/
dispatch(functionName, messageObject) {
- if (!this._dispatcher)
+ if (!this._dispatchers.length)
return;
- if (!(functionName in this._dispatcher)) {
+ if (!(functionName in this._dispatchers[0])) {
Protocol.InspectorBackend.reportProtocolError(
'Protocol Error: Attempted to dispatch an unimplemented method \'' + messageObject.method + '\'',
messageObject);
@@ -714,7 +714,8 @@ Protocol.InspectorBackend._DispatcherPrototype = class {
if (Protocol.InspectorBackend.Options.dumpInspectorTimeStats)
console.time(timingLabel);
- this._dispatcher[functionName].apply(this._dispatcher, params);
+ for (var index = 0; index < this._dispatchers.length; index++)
pfeldman 2017/02/03 03:01:08 ++index
+ this._dispatchers[index][functionName].apply(this._dispatchers[index], params);
if (Protocol.InspectorBackend.Options.dumpInspectorTimeStats)
console.timeEnd(timingLabel);

Powered by Google App Engine
This is Rietveld 408576698