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

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 e05a9caabf2b7c94bfda81a8d704d2ec3a73223e..559a82506a8e44a6597d698376b47dd923aa308d 100644
--- a/Source/devtools/front_end/HeapSnapshotView.js
+++ b/Source/devtools/front_end/HeapSnapshotView.js
@@ -980,7 +980,10 @@ WebInspector.TrackingHeapSnapshotProfileType.prototype = {
return this._toggleRecording();
},
- _startRecordingProfile: function()
+ /**
+ * @param {boolean=} continueAfterNavigation
+ */
+ _startRecordingProfile: function(continueAfterNavigation)
loislo 2014/02/19 13:06:19 could you please extract the common part into a se
yurys 2014/02/19 13:34:37 Done.
{
if (this.profileBeingRecorded())
return;
@@ -997,7 +1000,8 @@ WebInspector.TrackingHeapSnapshotProfileType.prototype = {
this._recording = true;
this.addProfile(this._profileBeingRecorded);
this._profileBeingRecorded.updateStatus(WebInspector.UIString("Recording\u2026"));
- HeapProfilerAgent.startTrackingHeapObjects(WebInspector.experimentsSettings.allocationProfiler.isEnabled());
+ if (!continueAfterNavigation)
+ HeapProfilerAgent.startTrackingHeapObjects(WebInspector.experimentsSettings.allocationProfiler.isEnabled());
this.dispatchEventToListeners(WebInspector.TrackingHeapSnapshotProfileType.TrackingStarted);
},
@@ -1045,11 +1049,14 @@ WebInspector.TrackingHeapSnapshotProfileType.prototype = {
_reset: function()
{
+ var wasRecording = this._recording;
+ // Clear current profile to avoid stoppting backend.
loislo 2014/02/19 13:06:19 stoppting?
yurys 2014/02/19 13:34:37 Done.
yurys 2014/02/19 13:34:37 Done.
+ this._profileBeingRecorded = null;
WebInspector.HeapSnapshotProfileType.prototype._reset.call(this);
- if (this._recording)
- this._stopRecordingProfile();
this._profileSamples = null;
this._lastSeenIndex = -1;
+ if (wasRecording)
+ this._startRecordingProfile(true);
},
/**
@@ -1137,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;
@@ -1146,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