| Index: third_party/WebKit/Source/devtools/front_end/sdk/TargetManager.js
|
| diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/TargetManager.js b/third_party/WebKit/Source/devtools/front_end/sdk/TargetManager.js
|
| index 1ff7ec90df08bf3e3f6f6dc38d0b96f67a5f0809..764df12099ddd7133c8dc10ec48e52757d28dda2 100644
|
| --- a/third_party/WebKit/Source/devtools/front_end/sdk/TargetManager.js
|
| +++ b/third_party/WebKit/Source/devtools/front_end/sdk/TargetManager.js
|
| @@ -19,6 +19,8 @@ WebInspector.TargetManager = function()
|
| /** @type {!Map<symbol, !Array<{modelClass: !Function, thisObject: (!Object|undefined), listener: function(!WebInspector.Event)}>>} */
|
| this._modelListeners = new Map();
|
| this._isSuspended = false;
|
| + /** @type {?WebInspector.TargetManager.MainChannelInterceptor} */
|
| + this._mainChannelInterceptor = null;
|
| }
|
|
|
| /** @enum {symbol} */
|
| @@ -183,13 +185,13 @@ WebInspector.TargetManager.prototype = {
|
| /**
|
| * @param {string} name
|
| * @param {number} capabilitiesMask
|
| - * @param {!InspectorBackendClass.Connection} connection
|
| + * @param {!InspectorBackendClass.Channel} channel
|
| * @param {?WebInspector.Target} parentTarget
|
| * @return {!WebInspector.Target}
|
| */
|
| - createTarget: function(name, capabilitiesMask, connection, parentTarget)
|
| + createTarget: function(name, capabilitiesMask, channel, parentTarget)
|
| {
|
| - var target = new WebInspector.Target(this, name, capabilitiesMask, connection, parentTarget);
|
| + var target = new WebInspector.Target(this, name, capabilitiesMask, channel, parentTarget);
|
|
|
| var logAgent = target.hasLogCapability() ? target.logAgent() : null;
|
|
|
| @@ -236,35 +238,19 @@ WebInspector.TargetManager.prototype = {
|
| },
|
|
|
| /**
|
| - * @param {function()} factory
|
| + * @param {?WebInspector.TargetManager.MainChannelInterceptor} mainChannelInterceptor
|
| */
|
| - setMainTargetFactory: function(factory)
|
| + setMainChannelInterceptor: function(mainChannelInterceptor)
|
| {
|
| - this._mainTargetFactory = factory;
|
| + this._mainChannelInterceptor = mainChannelInterceptor;
|
| },
|
|
|
| /**
|
| - * @param {function(string)} dispatch
|
| - * @return {!Promise<!WebInspector.RawProtocolConnection>}
|
| + * @return {?WebInspector.TargetManager.MainChannelInterceptor}
|
| */
|
| - interceptMainConnection: function(dispatch)
|
| + mainChannelInterceptor: function()
|
| {
|
| - var target = WebInspector.targetManager.mainTarget();
|
| - if (target)
|
| - target.connection().close();
|
| -
|
| - var fulfill;
|
| - var result = new Promise(resolve => fulfill = resolve);
|
| - InspectorFrontendHost.reattach(() => fulfill(new WebInspector.RawProtocolConnection(dispatch, yieldCallback.bind(this))));
|
| - return result;
|
| -
|
| - /**
|
| - * @this {WebInspector.TargetManager}
|
| - */
|
| - function yieldCallback()
|
| - {
|
| - InspectorFrontendHost.reattach(this._mainTargetFactory());
|
| - }
|
| + return this._mainChannelInterceptor;
|
| },
|
|
|
| /**
|
| @@ -420,6 +406,26 @@ WebInspector.TargetManager.Observer.prototype = {
|
| }
|
|
|
| /**
|
| + * @interface
|
| + */
|
| +WebInspector.TargetManager.MainChannelInterceptor = function()
|
| +{
|
| +}
|
| +
|
| +WebInspector.TargetManager.MainChannelInterceptor.prototype = {
|
| + /**
|
| + * @return {!Promise<!InspectorBackendClass.Channel>}
|
| + */
|
| + takeMainChannel: function()
|
| + {
|
| + },
|
| +
|
| + yieldMainChannel: function()
|
| + {
|
| + }
|
| +}
|
| +
|
| +/**
|
| * @type {!WebInspector.TargetManager}
|
| */
|
| WebInspector.targetManager = new WebInspector.TargetManager();
|
|
|