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

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

Issue 1960663003: DevTools: introduce the Clear storage pane in the resources panel. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tests fixed Created 4 years, 7 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/ApplicationCacheModel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/ApplicationCacheModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/ApplicationCacheModel.js
index 0c7f067af6877d6b78e02edb4af8ec7932aff658..1d0373d15aa7972728638a074a871e2b03bf580e 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/ApplicationCacheModel.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/ApplicationCacheModel.js
@@ -28,12 +28,12 @@
/**
* @constructor
- * @extends {WebInspector.SDKObject}
+ * @extends {WebInspector.SDKModel}
* @param {!WebInspector.Target} target
*/
WebInspector.ApplicationCacheModel = function(target)
{
- WebInspector.SDKObject.call(this, target);
+ WebInspector.SDKModel.call(this, WebInspector.ApplicationCacheModel, target);
target.registerApplicationCacheDispatcher(new WebInspector.ApplicationCacheDispatcher(this));
this._agent = target.applicationCacheAgent();
@@ -46,7 +46,6 @@ WebInspector.ApplicationCacheModel = function(target)
this._manifestURLsByFrame = {};
this._mainFrameNavigated();
-
this._onLine = true;
}
@@ -54,6 +53,7 @@ WebInspector.ApplicationCacheModel.EventTypes = {
FrameManifestStatusUpdated: "FrameManifestStatusUpdated",
FrameManifestAdded: "FrameManifestAdded",
FrameManifestRemoved: "FrameManifestRemoved",
+ FrameManifestsReset: "FrameManifestsReset",
NetworkStateChanged: "NetworkStateChanged"
}
@@ -78,6 +78,13 @@ WebInspector.ApplicationCacheModel.prototype = {
this._frameManifestRemoved(frame.id);
},
+ reset: function()
+ {
+ this._statuses = {};
+ this._manifestURLsByFrame = {};
+ this.dispatchEventToListeners(WebInspector.ApplicationCacheModel.EventTypes.FrameManifestsReset);
+ },
+
_mainFrameNavigated: function()
{
this._agent.getFramesWithManifests(this._framesWithManifestsLoaded.bind(this));
@@ -227,7 +234,7 @@ WebInspector.ApplicationCacheModel.prototype = {
this.dispatchEventToListeners(WebInspector.ApplicationCacheModel.EventTypes.NetworkStateChanged, isNowOnline);
},
- __proto__: WebInspector.SDKObject.prototype
+ __proto__: WebInspector.SDKModel.prototype
}
/**
@@ -260,3 +267,12 @@ WebInspector.ApplicationCacheDispatcher.prototype = {
this._applicationCacheModel._networkStateUpdated(isNowOnline);
}
}
+
+/**
+ * @param {!WebInspector.Target} target
+ * @return {?WebInspector.ApplicationCacheModel}
+ */
+WebInspector.ApplicationCacheModel.fromTarget = function(target)
+{
+ return /** @type {?WebInspector.ApplicationCacheModel} */ (target.model(WebInspector.ApplicationCacheModel));
+}

Powered by Google App Engine
This is Rietveld 408576698