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

Unified Diff: Source/devtools/front_end/sdk/ServiceWorkerManager.js

Issue 1023293004: [DevTools] Introduce Unregister/Start/Stop/Inspect buttons to ServiceWorkersView [2/2 blink] (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: update service-workers-view-expected.txt Created 5 years, 9 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
« no previous file with comments | « Source/devtools/front_end/resources/serviceWorkersView.css ('k') | Source/devtools/protocol.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 9abeacfec3e975abe545af688210507db72a3eda..bc5ba4b78b38036c122e512d3f37302cbc9bf584 100644
--- a/Source/devtools/front_end/sdk/ServiceWorkerManager.js
+++ b/Source/devtools/front_end/sdk/ServiceWorkerManager.js
@@ -38,6 +38,7 @@ WebInspector.ServiceWorkerManager = function(target)
WebInspector.SDKObject.call(this, target);
target.registerServiceWorkerDispatcher(new WebInspector.ServiceWorkerDispatcher(this));
this._lastAnonymousTargetId = 0;
+ this._agent = target.serviceWorkerAgent();
/** @type {!Map.<string, !WebInspector.ServiceWorker>} */
this._workers = new Map();
/** @type {!Map.<string, !ServiceWorkerAgent.ServiceWorkerRegistration>} */
@@ -62,7 +63,7 @@ WebInspector.ServiceWorkerManager.prototype = {
return;
this._enabled = true;
- this.target().serviceWorkerAgent().enable();
+ this._agent.enable();
WebInspector.targetManager.addEventListener(WebInspector.TargetManager.Events.MainFrameNavigated, this._mainFrameNavigated, this);
},
@@ -77,7 +78,7 @@ WebInspector.ServiceWorkerManager.prototype = {
this._workers.clear();
this._registrations.clear();
this._versions.clear();
- this.target().serviceWorkerAgent().disable();
+ this._agent.disable();
WebInspector.targetManager.removeEventListener(WebInspector.TargetManager.Events.MainFrameNavigated, this._mainFrameNavigated, this);
},
@@ -114,6 +115,38 @@ WebInspector.ServiceWorkerManager.prototype = {
},
/**
+ * @param {string} scope
+ */
+ unregister: function(scope)
+ {
+ this._agent.unregister(scope);
+ },
+
+ /**
+ * @param {string} scope
+ */
+ startWorker: function(scope)
+ {
+ this._agent.startWorker(scope);
+ },
+
+ /**
+ * @param {string} versionId
+ */
+ stopWorker: function(versionId)
+ {
+ this._agent.stopWorker(versionId);
+ },
+
+ /**
+ * @param {string} versionId
+ */
+ inspectWorker: function(versionId)
+ {
+ this._agent.inspectWorker(versionId);
+ },
+
+ /**
* @param {string} workerId
* @param {string} url
*/
« no previous file with comments | « Source/devtools/front_end/resources/serviceWorkersView.css ('k') | Source/devtools/protocol.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698