| Index: third_party/WebKit/Source/devtools/front_end/sdk/ServiceWorkerManager.js
|
| diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/ServiceWorkerManager.js b/third_party/WebKit/Source/devtools/front_end/sdk/ServiceWorkerManager.js
|
| index 4b0fc038d7b0be974e6663b4b50ea7fa838de29c..60a100d9cd1e52b8b82c027b15ab90f5ae07cb88 100644
|
| --- a/third_party/WebKit/Source/devtools/front_end/sdk/ServiceWorkerManager.js
|
| +++ b/third_party/WebKit/Source/devtools/front_end/sdk/ServiceWorkerManager.js
|
| @@ -34,12 +34,14 @@
|
| SDK.ServiceWorkerManager = class extends SDK.SDKModel {
|
| /**
|
| * @param {!SDK.Target} target
|
| + * @param {!Protocol.Dispatcher} dispatcher
|
| */
|
| - constructor(target) {
|
| - super(target);
|
| - target.registerServiceWorkerDispatcher(new SDK.ServiceWorkerDispatcher(this));
|
| + constructor(target, dispatcher) {
|
| + super(target, dispatcher);
|
| + dispatcher.registerServiceWorkerDispatcher(new SDK.ServiceWorkerDispatcher(this));
|
| this._lastAnonymousTargetId = 0;
|
| - this._agent = target.serviceWorkerAgent();
|
| + this._agent = dispatcher.serviceWorkerAgent();
|
| + this._targetAgent = dispatcher.targetAgent();
|
| /** @type {!Map.<string, !SDK.ServiceWorkerRegistration>} */
|
| this._registrations = new Map();
|
| this.enable();
|
| @@ -174,6 +176,21 @@ SDK.ServiceWorkerManager = class extends SDK.SDKModel {
|
| }
|
|
|
| /**
|
| + * @param {string} controlledClient
|
| + * @return {!Promise<?Protocol.Target.TargetInfo>}
|
| + */
|
| + controlledClientInfo(controlledClient) {
|
| + return this._targetAgent.getTargetInfo(controlledClient, (error, targetInfo) => error ? null : targetInfo);
|
| + }
|
| +
|
| + /**
|
| + * @param {string} controlledClient
|
| + */
|
| + activateControlledClient(controlledClient) {
|
| + this._targetAgent.activateTarget(controlledClient);
|
| + }
|
| +
|
| + /**
|
| * @param {!Array.<!Protocol.ServiceWorker.ServiceWorkerRegistration>} registrations
|
| */
|
| _workerRegistrationUpdated(registrations) {
|
|
|