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

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

Issue 2851913002: [DevTools] Do not expose agents on Target
Patch Set: storage and tests.js Created 3 years, 8 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 8dffb4581a19902f968543fd6458e0e65f608e80..1e82e6f92ab79d9e82ceb6448a7461c8c51aa7ce 100644
--- a/third_party/WebKit/Source/devtools/front_end/protocol/InspectorBackend.js
+++ b/third_party/WebKit/Source/devtools/front_end/protocol/InspectorBackend.js
@@ -67,22 +67,22 @@ Protocol.InspectorBackend = class {
var methodName = domain.substr(0, upperCaseLength).toLowerCase() + domain.slice(upperCaseLength) + 'Agent';
/**
- * @this {Protocol.TargetBase}
+ * @this {Protocol.Dispatcher}
*/
function agentGetter() {
return this._agents[domain];
}
- Protocol.TargetBase.prototype[methodName] = agentGetter;
+ Protocol.Dispatcher.prototype[methodName] = agentGetter;
/**
- * @this {Protocol.TargetBase}
+ * @this {Protocol.Dispatcher}
*/
function registerDispatcher(dispatcher) {
- this.registerDispatcher(domain, dispatcher);
+ this._registerDispatcher(domain, dispatcher);
}
- Protocol.TargetBase.prototype['register' + domain + 'Dispatcher'] = registerDispatcher;
+ Protocol.Dispatcher.prototype['register' + domain + 'Dispatcher'] = registerDispatcher;
}
/**
@@ -212,7 +212,7 @@ Protocol.InspectorBackend.Connection.Factory;
/**
* @unrestricted
*/
-Protocol.TargetBase = class {
+Protocol.Dispatcher = class {
/**
* @param {!Protocol.InspectorBackend.Connection.Factory} connectionFactory
*/
@@ -376,7 +376,7 @@ Protocol.TargetBase = class {
* @param {string} domain
* @param {!Object} dispatcher
*/
- registerDispatcher(domain, dispatcher) {
+ _registerDispatcher(domain, dispatcher) {
if (!this._dispatchers[domain])
return;
@@ -424,13 +424,15 @@ Protocol.TargetBase = class {
_onDisconnect(reason) {
this._connection = null;
this._runPendingCallbacks();
- this.dispose();
+ if (this._disposeCallback)
caseq 2017/04/29 02:12:53 Rename to _disconnectCallback.
+ this._disposeCallback.call(null);
}
/**
- * @protected
+ * @param {function()} callback
*/
- dispose() {
+ setDisposeCallback(callback) {
+ this._disposeCallback = callback;
}
/**
@@ -484,7 +486,7 @@ Protocol.InspectorBackend._AgentPrototype = class {
}
/**
- * @param {!Protocol.TargetBase} target
+ * @param {!Protocol.Dispatcher} target
caseq 2017/04/29 02:12:53 This is confusing. Should this be renamed?
*/
setTarget(target) {
this._target = target;

Powered by Google App Engine
This is Rietveld 408576698