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

Unified Diff: Source/devtools/front_end/ProfilesPanel.js

Issue 136793008: Clear DevTools temp storage (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 11 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: Source/devtools/front_end/ProfilesPanel.js
diff --git a/Source/devtools/front_end/ProfilesPanel.js b/Source/devtools/front_end/ProfilesPanel.js
index 8a569e4522ccda2755c7b87edf8704e0b46c32bd..137a5d2d619535a6922ddf00b8f3d1593580ab72 100644
--- a/Source/devtools/front_end/ProfilesPanel.js
+++ b/Source/devtools/front_end/ProfilesPanel.js
@@ -39,6 +39,8 @@ WebInspector.ProfileType = function(id, name)
this.treeElement = null;
/** @type {?WebInspector.ProfileHeader} */
this._profileBeingRecorded = null;
+
+ window.addEventListener("unload", this._clearTempStorage.bind(this), false);
}
WebInspector.ProfileType.Events = {
@@ -206,6 +208,12 @@ WebInspector.ProfileType.prototype = {
}
},
+ _clearTempStorage: function()
+ {
+ for (var i = 0; i < this._profiles.length; ++i)
+ this._profiles[i].removeTempFile();
+ },
+
/**
* @nosideeffects
* @return {?WebInspector.ProfileHeader}
@@ -297,6 +305,12 @@ WebInspector.ProfileHeader.prototype = {
throw new Error("Not implemented.");
},
+ removeTempFile: function()
+ {
+ if (this._tempFile)
+ this._tempFile.remove();
+ },
+
dispose: function()
{
},

Powered by Google App Engine
This is Rietveld 408576698