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

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

Issue 268293003: DevTools: Get rid of WebInspector.panels (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 6 years, 7 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 622f75993d47ad0d66a5c5dfea4e0b01baf6da7b..45736db08137a7a27991991e2ed202ade13c7266 100644
--- a/Source/devtools/front_end/profiler/HeapSnapshotView.js
+++ b/Source/devtools/front_end/profiler/HeapSnapshotView.js
@@ -31,9 +31,10 @@
/**
* @constructor
* @extends {WebInspector.VBox}
+ * @param {!WebInspector.ProfileType.DataDisplayDelegate} dataDisplayDelegate
* @param {!WebInspector.HeapProfileHeader} profile
*/
-WebInspector.HeapSnapshotView = function(profile)
+WebInspector.HeapSnapshotView = function(dataDisplayDelegate, profile)
{
WebInspector.VBox.call(this);
@@ -52,7 +53,7 @@ WebInspector.HeapSnapshotView = function(profile)
this._containmentView = new WebInspector.VBox();
this._containmentView.setMinimumSize(50, 25);
- this._containmentDataGrid = new WebInspector.HeapSnapshotContainmentDataGrid();
+ this._containmentDataGrid = new WebInspector.HeapSnapshotContainmentDataGrid(dataDisplayDelegate);
this._containmentDataGrid.show(this._containmentView.element);
this._containmentDataGrid.addEventListener(WebInspector.DataGrid.Events.SelectedNode, this._selectionChanged, this);
@@ -61,27 +62,27 @@ WebInspector.HeapSnapshotView = function(profile)
this._constructorsView = new WebInspector.VBox();
this._constructorsView.setMinimumSize(50, 25);
- this._constructorsDataGrid = new WebInspector.HeapSnapshotConstructorsDataGrid();
+ this._constructorsDataGrid = new WebInspector.HeapSnapshotConstructorsDataGrid(dataDisplayDelegate);
this._constructorsDataGrid.show(this._constructorsView.element);
this._constructorsDataGrid.addEventListener(WebInspector.DataGrid.Events.SelectedNode, this._selectionChanged, this);
this._diffView = new WebInspector.VBox();
this._diffView.setMinimumSize(50, 25);
- this._diffDataGrid = new WebInspector.HeapSnapshotDiffDataGrid();
+ this._diffDataGrid = new WebInspector.HeapSnapshotDiffDataGrid(dataDisplayDelegate);
this._diffDataGrid.show(this._diffView.element);
this._diffDataGrid.addEventListener(WebInspector.DataGrid.Events.SelectedNode, this._selectionChanged, this);
this._dominatorView = new WebInspector.VBox();
this._dominatorView.setMinimumSize(50, 25);
- this._dominatorDataGrid = new WebInspector.HeapSnapshotDominatorsDataGrid();
+ this._dominatorDataGrid = new WebInspector.HeapSnapshotDominatorsDataGrid(dataDisplayDelegate);
this._dominatorDataGrid.show(this._dominatorView.element);
this._dominatorDataGrid.addEventListener(WebInspector.DataGrid.Events.SelectedNode, this._selectionChanged, this);
if (WebInspector.experimentsSettings.allocationProfiler.isEnabled() && profile.profileType() === WebInspector.ProfileTypeRegistry.instance.trackingHeapSnapshotProfileType) {
this._allocationView = new WebInspector.VBox();
this._allocationView.setMinimumSize(50, 25);
- this._allocationDataGrid = new WebInspector.AllocationDataGrid();
+ this._allocationDataGrid = new WebInspector.AllocationDataGrid(dataDisplayDelegate);
this._allocationDataGrid.addEventListener(WebInspector.DataGrid.Events.SelectedNode, this._onSelectAllocationNode, this);
this._allocationDataGrid.show(this._allocationView.element);
@@ -121,7 +122,7 @@ WebInspector.HeapSnapshotView = function(profile)
this._splitView.hideDefaultResizer();
this._splitView.installResizer(splitViewResizer);
- this._retainmentDataGrid = new WebInspector.HeapSnapshotRetainmentDataGrid();
+ this._retainmentDataGrid = new WebInspector.HeapSnapshotRetainmentDataGrid(dataDisplayDelegate);
this._retainmentDataGrid.show(this._retainmentView.element);
this._retainmentDataGrid.addEventListener(WebInspector.DataGrid.Events.SelectedNode, this._inspectedObjectChanged, this);
this._retainmentDataGrid.reset();
@@ -1226,7 +1227,7 @@ WebInspector.HeapSnapshotProfileType.prototype = {
profile.title = WebInspector.UIString("Snapshot %d", profile.uid);
profile._finishLoad();
this.setProfileBeingRecorded(null);
- WebInspector.panels.profiles.showProfile(profile);
+ this.dispatchEventToListeners(WebInspector.ProfileType.Events.ProfileComplete, profile);
callback();
}
HeapProfilerAgent.takeHeapSnapshot(true, didTakeHeapSnapshot.bind(this));
@@ -1411,7 +1412,7 @@ WebInspector.TrackingHeapSnapshotProfileType.prototype = {
profile._finishLoad();
this._profileSamples = null;
this.setProfileBeingRecorded(null);
- WebInspector.panels.profiles.showProfile(profile);
+ this.dispatchEventToListeners(WebInspector.ProfileType.Events.ProfileComplete, profile);
}
HeapProfilerAgent.stopTrackingHeapObjects(true, didTakeHeapSnapshot.bind(this));
@@ -1499,20 +1500,22 @@ WebInspector.HeapProfileHeader = function(target, type, title)
WebInspector.HeapProfileHeader.prototype = {
/**
* @override
+ * @param {!WebInspector.ProfileType.DataDisplayDelegate} dataDisplayDelegate
* @return {!WebInspector.ProfileSidebarTreeElement}
*/
- createSidebarTreeElement: function()
+ createSidebarTreeElement: function(dataDisplayDelegate)
{
- return new WebInspector.ProfileSidebarTreeElement(this, "heap-snapshot-sidebar-tree-item");
+ return new WebInspector.ProfileSidebarTreeElement(dataDisplayDelegate, this, "heap-snapshot-sidebar-tree-item");
},
/**
* @override
+ * @param {!WebInspector.ProfileType.DataDisplayDelegate} dataDisplayDelegate
* @return {!WebInspector.HeapSnapshotView}
*/
- createView: function()
+ createView: function(dataDisplayDelegate)
{
- return new WebInspector.HeapSnapshotView(this);
+ return new WebInspector.HeapSnapshotView(dataDisplayDelegate, this);
},
/**
« no previous file with comments | « Source/devtools/front_end/profiler/HeapSnapshotDataGrids.js ('k') | Source/devtools/front_end/profiler/ProfilesPanel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698