Chromium Code Reviews| Index: Source/devtools/front_end/sdk/ServiceWorkerManager.js |
| diff --git a/Source/devtools/front_end/sdk/ServiceWorkerManager.js b/Source/devtools/front_end/sdk/ServiceWorkerManager.js |
| index 2602308d39c450ab8d53c72fc3dbe039a9607377..7101ae829d625fb6ecf8fed59cfa4acc4a46ad23 100644 |
| --- a/Source/devtools/front_end/sdk/ServiceWorkerManager.js |
| +++ b/Source/devtools/front_end/sdk/ServiceWorkerManager.js |
| @@ -162,6 +162,14 @@ WebInspector.ServiceWorkerManager.prototype = { |
| }, |
| /** |
| + * @param {string} targetId |
|
pfeldman
2015/06/12 20:31:34
Here and below {ServiceWorker.TargetID}
horo
2015/06/15 03:12:43
Done.
|
| + */ |
| + activateTarget: function(targetId) |
| + { |
| + this._agent.activateTarget(targetId); |
| + }, |
| + |
| + /** |
| * @param {string} scope |
| */ |
| _unregister: function(scope) |
| @@ -202,6 +210,28 @@ WebInspector.ServiceWorkerManager.prototype = { |
| }, |
| /** |
| + * @param {string} targetId |
| + * @param {function(?WebInspector.TargetInfo)=} callback |
| + */ |
| + getTargetInfo: function(targetId, callback) |
| + { |
| + /** |
| + * @param {?Protocol.Error} error |
| + * @param {?ServiceWorkerAgent.TargetInfo} targetInfo |
| + */ |
| + function innerCallback(error, targetInfo) |
| + { |
| + if (error) |
| + console.error(error); |
|
pfeldman
2015/06/12 20:31:34
callback(null); return; here
horo
2015/06/15 03:12:43
Done.
|
| + if (targetInfo) |
| + callback(new WebInspector.TargetInfo(targetInfo)); |
| + else |
| + callback(null) |
| + } |
| + this._agent.getTargetInfo(targetId, innerCallback); |
| + }, |
| + |
| + /** |
| * @param {string} workerId |
| * @param {string} url |
| */ |
| @@ -502,6 +532,35 @@ WebInspector.ServiceWorkerConnection.prototype = { |
| /** |
| * @constructor |
| + * @param {!ServiceWorkerAgent.TargetInfo} payload |
| + */ |
| +WebInspector.TargetInfo = function(payload) |
| +{ |
| + this.id = payload.id; |
| + this.type = payload.type; |
| + this.title = payload.title; |
| + this.url = payload.url; |
| +} |
| + |
| +WebInspector.TargetInfo.prototype = { |
| + /** |
| + * @return {boolean} |
| + */ |
| + isWebContents: function() |
| + { |
| + return this.type == "web_contents"; |
| + }, |
| + /** |
| + * @return {boolean} |
| + */ |
| + isFrame: function() |
| + { |
| + return this.type == "frame"; |
| + }, |
| +} |
| + |
| +/** |
| + * @constructor |
| * @param {!ServiceWorkerAgent.ServiceWorkerErrorMessage} payload |
| */ |
| WebInspector.ServiceWorkerErrorMessage = function(payload) |
| @@ -537,6 +596,10 @@ WebInspector.ServiceWorkerVersion.prototype = { |
| this.status = payload.status; |
| this.scriptLastModified = payload.scriptLastModified; |
| this.scriptResponseTime = payload.scriptResponseTime; |
| + this.controlledClients = [] |
| + for (var i = 0; i < payload.controlledClients.length; ++i) { |
| + this.controlledClients.push(payload.controlledClients[i]); |
|
pfeldman
2015/06/12 20:31:34
4 spaces, {} around.
horo
2015/06/15 03:12:43
Done.
|
| + } |
| }, |
| /** |