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

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

Issue 1841863003: DevTools: move the force update SW on reload checkbox to the Resources / Service Workers view. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
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 9dd635d90cee2bf49b7fcdf81799fb3cda8a1f50..90bb6cbdfdd3ba4eb246af9d108054eb1e67e9fe 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/ServiceWorkerManager.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/ServiceWorkerManager.js
@@ -44,6 +44,10 @@ WebInspector.ServiceWorkerManager = function(target)
/** @type {!Map.<string, !WebInspector.ServiceWorkerRegistration>} */
this._registrations = new Map();
this.enable();
+ this._forceUpdateSetting = WebInspector.settings.moduleSetting("serviceWorkerUpdateOnReload");
dgozman 2016/03/30 21:09:54 Just createSetting(), don't declare it in module.j
pfeldman 2016/03/31 05:02:31 Done.
+ if (this._forceUpdateSetting.get())
+ this._forceUpdateSettingChanged();
+ this._forceUpdateSetting.addChangeListener(this._forceUpdateSettingChanged, this);
}
WebInspector.ServiceWorkerManager.Events = {
@@ -111,15 +115,6 @@ WebInspector.ServiceWorkerManager.prototype = {
},
/**
- * @param {string} registrationId
- * @param {boolean} flag
- */
- setForceUpdateOnPageLoad: function(registrationId, flag)
- {
- this._agent.setForceUpdateOnPageLoad(registrationId, flag);
- },
-
- /**
* @return {!Map.<string, !WebInspector.ServiceWorkerRegistration>}
*/
registrations: function()
@@ -362,6 +357,19 @@ WebInspector.ServiceWorkerManager.prototype = {
// Attach to the new worker set.
},
+ /**
+ * @return {!WebInspector.Setting}
+ */
+ forceUpdateOnReloadSetting: function()
+ {
+ return this._forceUpdateSetting;
+ },
+
+ _forceUpdateSettingChanged: function()
+ {
+ this._agent.setForceUpdateOnPageLoad(this._forceUpdateSetting.get());
+ },
+
__proto__: WebInspector.SDKObject.prototype
}

Powered by Google App Engine
This is Rietveld 408576698