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

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

Issue 400633003: DevTools: introduce multitarget model listeners (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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/profiler/HeapSnapshotView.js
diff --git a/Source/devtools/front_end/profiler/HeapSnapshotView.js b/Source/devtools/front_end/profiler/HeapSnapshotView.js
index b7f793d7f83a9f74be5e75a18aa4d8af1152898b..32c32f7a7545e3f7f25511621ee00a69cb342b65 100644
--- a/Source/devtools/front_end/profiler/HeapSnapshotView.js
+++ b/Source/devtools/front_end/profiler/HeapSnapshotView.js
@@ -1012,6 +1012,9 @@ WebInspector.HeapSnapshotProfileType = function(id, title)
{
WebInspector.ProfileType.call(this, id || WebInspector.HeapSnapshotProfileType.TypeId, title || WebInspector.UIString("Take Heap Snapshot"));
WebInspector.targetManager.observeTargets(this);
+ WebInspector.targetManager.addModelListener(WebInspector.HeapProfilerModel, WebInspector.HeapProfilerModel.Events.ResetProfiles, this._resetProfiles, this);
+ WebInspector.targetManager.addModelListener(WebInspector.HeapProfilerModel, WebInspector.HeapProfilerModel.Events.AddHeapSnapshotChunk, this._addHeapSnapshotChunk, this);
+ WebInspector.targetManager.addModelListener(WebInspector.HeapProfilerModel, WebInspector.HeapProfilerModel.Events.ReportHeapSnapshotProgress, this._reportHeapSnapshotProgress, this);
}
WebInspector.HeapSnapshotProfileType.TypeId = "HEAP";
@@ -1024,9 +1027,6 @@ WebInspector.HeapSnapshotProfileType.prototype = {
targetAdded: function(target)
{
target.heapProfilerModel.enable();
- target.heapProfilerModel.addEventListener(WebInspector.HeapProfilerModel.Events.ResetProfiles, this._resetProfiles, this);
- target.heapProfilerModel.addEventListener(WebInspector.HeapProfilerModel.Events.AddHeapSnapshotChunk, this._addHeapSnapshotChunk, this);
- target.heapProfilerModel.addEventListener(WebInspector.HeapProfilerModel.Events.ReportHeapSnapshotProgress, this._reportHeapSnapshotProgress, this);
},
/**
@@ -1034,9 +1034,6 @@ WebInspector.HeapSnapshotProfileType.prototype = {
*/
targetRemoved: function(target)
{
- target.heapProfilerModel.removeEventListener(WebInspector.HeapProfilerModel.Events.ResetProfiles, this._resetProfiles, this);
- target.heapProfilerModel.removeEventListener(WebInspector.HeapProfilerModel.Events.AddHeapSnapshotChunk, this._addHeapSnapshotChunk, this);
- target.heapProfilerModel.removeEventListener(WebInspector.HeapProfilerModel.Events.ReportHeapSnapshotProgress, this._reportHeapSnapshotProgress, this);
},
/**
« no previous file with comments | « Source/devtools/front_end/profiler/CPUProfileView.js ('k') | Source/devtools/front_end/sdk/CPUProfilerModel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698