OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 21 matching lines...) Expand all Loading... |
32 WebInspector.ProfileType = function(id, name) | 32 WebInspector.ProfileType = function(id, name) |
33 { | 33 { |
34 this._id = id; | 34 this._id = id; |
35 this._name = name; | 35 this._name = name; |
36 /** @type {!Array.<!WebInspector.ProfileHeader>} */ | 36 /** @type {!Array.<!WebInspector.ProfileHeader>} */ |
37 this._profiles = []; | 37 this._profiles = []; |
38 /** @type {?WebInspector.SidebarSectionTreeElement} */ | 38 /** @type {?WebInspector.SidebarSectionTreeElement} */ |
39 this.treeElement = null; | 39 this.treeElement = null; |
40 /** @type {?WebInspector.ProfileHeader} */ | 40 /** @type {?WebInspector.ProfileHeader} */ |
41 this._profileBeingRecorded = null; | 41 this._profileBeingRecorded = null; |
| 42 |
| 43 window.addEventListener("unload", this._clearTempStorage.bind(this), false); |
42 } | 44 } |
43 | 45 |
44 WebInspector.ProfileType.Events = { | 46 WebInspector.ProfileType.Events = { |
45 AddProfileHeader: "add-profile-header", | 47 AddProfileHeader: "add-profile-header", |
46 RemoveProfileHeader: "remove-profile-header", | 48 RemoveProfileHeader: "remove-profile-header", |
47 ViewUpdated: "view-updated" | 49 ViewUpdated: "view-updated" |
48 } | 50 } |
49 | 51 |
50 WebInspector.ProfileType.prototype = { | 52 WebInspector.ProfileType.prototype = { |
51 /** | 53 /** |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 if (this._profileBeingRecorded === profile) | 201 if (this._profileBeingRecorded === profile) |
200 this._profileBeingRecorded = null; | 202 this._profileBeingRecorded = null; |
201 for (var i = 0; i < this._profiles.length; ++i) { | 203 for (var i = 0; i < this._profiles.length; ++i) { |
202 if (this._profiles[i].uid === profile.uid) { | 204 if (this._profiles[i].uid === profile.uid) { |
203 this._profiles.splice(i, 1); | 205 this._profiles.splice(i, 1); |
204 break; | 206 break; |
205 } | 207 } |
206 } | 208 } |
207 }, | 209 }, |
208 | 210 |
| 211 _clearTempStorage: function() |
| 212 { |
| 213 for (var i = 0; i < this._profiles.length; ++i) |
| 214 this._profiles[i].removeTempFile(); |
| 215 }, |
| 216 |
209 /** | 217 /** |
210 * @nosideeffects | 218 * @nosideeffects |
211 * @return {?WebInspector.ProfileHeader} | 219 * @return {?WebInspector.ProfileHeader} |
212 */ | 220 */ |
213 profileBeingRecorded: function() | 221 profileBeingRecorded: function() |
214 { | 222 { |
215 return this._profileBeingRecorded; | 223 return this._profileBeingRecorded; |
216 }, | 224 }, |
217 | 225 |
218 _reset: function() | 226 _reset: function() |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 | 298 |
291 /** | 299 /** |
292 * @param {!WebInspector.ProfilesPanel} panel | 300 * @param {!WebInspector.ProfilesPanel} panel |
293 * @return {!WebInspector.View} | 301 * @return {!WebInspector.View} |
294 */ | 302 */ |
295 createView: function(panel) | 303 createView: function(panel) |
296 { | 304 { |
297 throw new Error("Not implemented."); | 305 throw new Error("Not implemented."); |
298 }, | 306 }, |
299 | 307 |
| 308 removeTempFile: function() |
| 309 { |
| 310 if (this._tempFile) |
| 311 this._tempFile.remove(); |
| 312 }, |
| 313 |
300 dispose: function() | 314 dispose: function() |
301 { | 315 { |
302 }, | 316 }, |
303 | 317 |
304 /** | 318 /** |
305 * @param {!Function} callback | 319 * @param {!Function} callback |
306 */ | 320 */ |
307 load: function(callback) | 321 load: function(callback) |
308 { | 322 { |
309 }, | 323 }, |
(...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1179 importScript("HeapSnapshotDataGrids.js"); | 1193 importScript("HeapSnapshotDataGrids.js"); |
1180 importScript("HeapSnapshotGridNodes.js"); | 1194 importScript("HeapSnapshotGridNodes.js"); |
1181 importScript("HeapSnapshotLoader.js"); | 1195 importScript("HeapSnapshotLoader.js"); |
1182 importScript("HeapSnapshotView.js"); | 1196 importScript("HeapSnapshotView.js"); |
1183 importScript("HeapSnapshotWorkerDispatcher.js"); | 1197 importScript("HeapSnapshotWorkerDispatcher.js"); |
1184 importScript("JSHeapSnapshot.js"); | 1198 importScript("JSHeapSnapshot.js"); |
1185 importScript("ProfileLauncherView.js"); | 1199 importScript("ProfileLauncherView.js"); |
1186 importScript("TopDownProfileDataGridTree.js"); | 1200 importScript("TopDownProfileDataGridTree.js"); |
1187 importScript("CanvasProfileView.js"); | 1201 importScript("CanvasProfileView.js"); |
1188 importScript("CanvasReplayStateView.js"); | 1202 importScript("CanvasReplayStateView.js"); |
OLD | NEW |