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

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: test fixed 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..a8a719c85953ca9ad7d367a989476bb8bb033420 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/ServiceWorkerManager.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/ServiceWorkerManager.js
@@ -44,13 +44,16 @@ WebInspector.ServiceWorkerManager = function(target)
/** @type {!Map.<string, !WebInspector.ServiceWorkerRegistration>} */
this._registrations = new Map();
this.enable();
+ this._forceUpdateSetting = WebInspector.settings.createSetting("serviceWorkerUpdateOnReload", false);
+ if (this._forceUpdateSetting.get())
+ this._forceUpdateSettingChanged();
+ this._forceUpdateSetting.addChangeListener(this._forceUpdateSettingChanged, this);
}
WebInspector.ServiceWorkerManager.Events = {
WorkersUpdated: "WorkersUpdated",
RegistrationUpdated: "RegistrationUpdated",
- RegistrationDeleted: "RegistrationDeleted",
- DebugOnStartUpdated: "DebugOnStartUpdated"
+ RegistrationDeleted: "RegistrationDeleted"
}
WebInspector.ServiceWorkerManager.prototype = {
@@ -95,31 +98,6 @@ WebInspector.ServiceWorkerManager.prototype = {
},
/**
- * @return {boolean}
- */
- debugOnStart: function()
- {
- return !!this._debugOnStart;
- },
-
- /**
- * @param {boolean} flag
- */
- setDebugOnStart: function(flag)
- {
- this._agent.setDebugOnStart(flag);
- },
-
- /**
- * @param {string} registrationId
- * @param {boolean} flag
- */
- setForceUpdateOnPageLoad: function(registrationId, flag)
- {
- this._agent.setForceUpdateOnPageLoad(registrationId, flag);
- },
-
- /**
* @return {!Map.<string, !WebInspector.ServiceWorkerRegistration>}
*/
registrations: function()
@@ -346,20 +324,24 @@ WebInspector.ServiceWorkerManager.prototype = {
},
/**
- * @param {boolean} flag
+ * @param {!WebInspector.Event} event
*/
- _debugOnStartUpdated: function(flag)
+ _mainFrameNavigated: function(event)
{
- this._debugOnStart = flag;
- this.dispatchEventToListeners(WebInspector.ServiceWorkerManager.Events.DebugOnStartUpdated, flag);
+ // Attach to the new worker set.
},
/**
- * @param {!WebInspector.Event} event
+ * @return {!WebInspector.Setting}
*/
- _mainFrameNavigated: function(event)
+ forceUpdateOnReloadSetting: function()
{
- // Attach to the new worker set.
+ return this._forceUpdateSetting;
+ },
+
+ _forceUpdateSettingChanged: function()
+ {
+ this._agent.setForceUpdateOnPageLoad(this._forceUpdateSetting.get());
},
__proto__: WebInspector.SDKObject.prototype
@@ -503,15 +485,6 @@ WebInspector.ServiceWorkerDispatcher.prototype = {
workerErrorReported: function(errorMessage)
{
this._manager._workerErrorReported(errorMessage);
- },
-
- /**
- * @override
- * @param {boolean} flag
- */
- debugOnStartUpdated: function(flag)
- {
- this._manager._debugOnStartUpdated(flag);
}
}

Powered by Google App Engine
This is Rietveld 408576698