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

Unified Diff: third_party/WebKit/Source/devtools/front_end/resources/DatabaseModel.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/resources/DatabaseModel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/resources/DatabaseModel.js b/third_party/WebKit/Source/devtools/front_end/resources/DatabaseModel.js
index 89aa63bd3c466d2819bb9679dfd32218d0136b7d..157e995c19c52b3d9b738dda160afeb49213f3b1 100644
--- a/third_party/WebKit/Source/devtools/front_end/resources/DatabaseModel.js
+++ b/third_party/WebKit/Source/devtools/front_end/resources/DatabaseModel.js
@@ -143,10 +143,12 @@ WebInspector.DatabaseModel = function(target)
this._databases = [];
this._agent = target.databaseAgent();
+ this.target().registerDatabaseDispatcher(new WebInspector.DatabaseDispatcher(this));
}
WebInspector.DatabaseModel.Events = {
- DatabaseAdded: "DatabaseAdded"
+ DatabaseAdded: "DatabaseAdded",
+ DatabasesRemoved: "DatabasesRemoved"
}
WebInspector.DatabaseModel.prototype = {
@@ -154,11 +156,20 @@ WebInspector.DatabaseModel.prototype = {
{
if (this._enabled)
return;
- this.target().registerDatabaseDispatcher(new WebInspector.DatabaseDispatcher(this));
this._agent.enable();
this._enabled = true;
},
+ disable: function()
+ {
+ if (!this._enabled)
+ return;
+ this._enabled = false;
+ this._databases = [];
+ this._agent.disable();
+ this.dispatchEventToListeners(WebInspector.DatabaseModel.Events.DatabasesRemoved);
+ },
+
/**
* @return {!Array.<!WebInspector.Database>}
*/

Powered by Google App Engine
This is Rietveld 408576698