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

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

Issue 172163005: Continue recording object allocation after navigation (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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
« no previous file with comments | « Source/core/inspector/InspectorHeapProfilerAgent.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/HeapSnapshotView.js
diff --git a/Source/devtools/front_end/HeapSnapshotView.js b/Source/devtools/front_end/HeapSnapshotView.js
index 569c2fd1e5967bc13ae224e6ddb6f8b1b9682c63..17f98ccc134e1cb606ae2f6ff7bb05664b0acdf4 100644
--- a/Source/devtools/front_end/HeapSnapshotView.js
+++ b/Source/devtools/front_end/HeapSnapshotView.js
@@ -983,6 +983,12 @@ WebInspector.TrackingHeapSnapshotProfileType.prototype = {
{
if (this.profileBeingRecorded())
return;
+ this._addNewProfile();
+ HeapProfilerAgent.startTrackingHeapObjects(WebInspector.experimentsSettings.allocationProfiler.isEnabled());
+ },
+
+ _addNewProfile: function()
+ {
this._profileBeingRecorded = new WebInspector.HeapProfileHeader(this);
this._lastSeenIndex = -1;
this._profileSamples = {
@@ -996,7 +1002,6 @@ WebInspector.TrackingHeapSnapshotProfileType.prototype = {
this._recording = true;
this.addProfile(this._profileBeingRecorded);
this._profileBeingRecorded.updateStatus(WebInspector.UIString("Recording\u2026"));
- HeapProfilerAgent.startTrackingHeapObjects(WebInspector.experimentsSettings.allocationProfiler.isEnabled());
this.dispatchEventToListeners(WebInspector.TrackingHeapSnapshotProfileType.TrackingStarted);
},
@@ -1044,11 +1049,14 @@ WebInspector.TrackingHeapSnapshotProfileType.prototype = {
_reset: function()
{
+ var wasRecording = this._recording;
+ // Clear current profile to avoid stopping backend.
+ this._profileBeingRecorded = null;
WebInspector.HeapSnapshotProfileType.prototype._reset.call(this);
- if (this._recording)
- this._stopRecordingProfile();
this._profileSamples = null;
this._lastSeenIndex = -1;
+ if (wasRecording)
+ this._addNewProfile();
},
/**
@@ -1136,7 +1144,8 @@ WebInspector.HeapProfileHeader.prototype = {
_finishLoad: function()
{
- this._receiver.close(function() {});
+ if (!this._wasDisposed)
+ this._receiver.close(function() {});
if (this._bufferedWriter) {
this._bufferedWriter.close(this._didWriteToTempFile.bind(this));
this._bufferedWriter = null;
@@ -1145,6 +1154,11 @@ WebInspector.HeapProfileHeader.prototype = {
_didWriteToTempFile: function(tempFile)
{
+ if (this._wasDisposed) {
+ if (tempFile)
+ tempFile.remove();
+ return;
+ }
this._tempFile = tempFile;
if (!tempFile)
this._failedToCreateTempFile = true;
« no previous file with comments | « Source/core/inspector/InspectorHeapProfilerAgent.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698