| Index: Source/devtools/front_end/profiler/HeapSnapshotDataGrids.js
|
| diff --git a/Source/devtools/front_end/profiler/HeapSnapshotDataGrids.js b/Source/devtools/front_end/profiler/HeapSnapshotDataGrids.js
|
| index 1badba6770363c097a8832c0e614742203504275..43f013ac8b468cb5288201f89cec5997bf8d54d9 100644
|
| --- a/Source/devtools/front_end/profiler/HeapSnapshotDataGrids.js
|
| +++ b/Source/devtools/front_end/profiler/HeapSnapshotDataGrids.js
|
| @@ -31,10 +31,13 @@
|
| /**
|
| * @constructor
|
| * @extends {WebInspector.DataGrid}
|
| + * @param {!WebInspector.ProfilesPanel} panel
|
| + * @param {!Array.<!WebInspector.DataGrid.ColumnDescriptor>} columns
|
| */
|
| -WebInspector.HeapSnapshotSortableDataGrid = function(columns)
|
| +WebInspector.HeapSnapshotSortableDataGrid = function(panel, columns)
|
| {
|
| WebInspector.DataGrid.call(this, columns);
|
| + this._panel = panel;
|
|
|
| /**
|
| * @type {number}
|
| @@ -125,22 +128,30 @@ WebInspector.HeapSnapshotSortableDataGrid.prototype = {
|
| if (!td)
|
| return;
|
| var node = td.heapSnapshotNode;
|
| +
|
| + /**
|
| + * @this {WebInspector.HeapSnapshotSortableDataGrid}
|
| + */
|
| function revealInDominatorsView()
|
| {
|
| - WebInspector.panels.profiles.showObject(node.snapshotNodeId, "Dominators");
|
| + this._panel.showObject(node.snapshotNodeId, "Dominators");
|
| }
|
| +
|
| + /**
|
| + * @this {WebInspector.HeapSnapshotSortableDataGrid}
|
| + */
|
| function revealInSummaryView()
|
| {
|
| - WebInspector.panels.profiles.showObject(node.snapshotNodeId, "Summary");
|
| + this._panel.showObject(node.snapshotNodeId, "Summary");
|
| }
|
| - if(node instanceof WebInspector.HeapSnapshotRetainingObjectNode) {
|
| - contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Reveal in Summary view" : "Reveal in Summary View"), revealInSummaryView);
|
| - contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Reveal in Dominators view" : "Reveal in Dominators View"), revealInDominatorsView);
|
| - }
|
| - else if (node instanceof WebInspector.HeapSnapshotInstanceNode || node instanceof WebInspector.HeapSnapshotObjectNode) {
|
| - contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Reveal in Dominators view" : "Reveal in Dominators View"), revealInDominatorsView);
|
| +
|
| + if (node instanceof WebInspector.HeapSnapshotRetainingObjectNode) {
|
| + contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Reveal in Summary view" : "Reveal in Summary View"), revealInSummaryView.bind(this));
|
| + contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Reveal in Dominators view" : "Reveal in Dominators View"), revealInDominatorsView.bind(this));
|
| + } else if (node instanceof WebInspector.HeapSnapshotInstanceNode || node instanceof WebInspector.HeapSnapshotObjectNode) {
|
| + contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Reveal in Dominators view" : "Reveal in Dominators View"), revealInDominatorsView.bind(this));
|
| } else if (node instanceof WebInspector.HeapSnapshotDominatorObjectNode) {
|
| - contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Reveal in Summary view" : "Reveal in Summary View"), revealInSummaryView);
|
| + contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Reveal in Summary view" : "Reveal in Summary View"), revealInSummaryView.bind(this));
|
| }
|
| },
|
|
|
| @@ -318,10 +329,12 @@ WebInspector.HeapSnapshotSortableDataGrid.prototype = {
|
| /**
|
| * @constructor
|
| * @extends {WebInspector.HeapSnapshotSortableDataGrid}
|
| + * @param {!WebInspector.ProfilesPanel} panel
|
| + * @param {!Array.<!WebInspector.DataGrid.ColumnDescriptor>} columns
|
| */
|
| -WebInspector.HeapSnapshotViewportDataGrid = function(columns)
|
| +WebInspector.HeapSnapshotViewportDataGrid = function(panel, columns)
|
| {
|
| - WebInspector.HeapSnapshotSortableDataGrid.call(this, columns);
|
| + WebInspector.HeapSnapshotSortableDataGrid.call(this, panel, columns);
|
| this.scrollContainer.addEventListener("scroll", this._onScroll.bind(this), true);
|
| /**
|
| * @type {?WebInspector.HeapSnapshotGridNode}
|
| @@ -606,9 +619,10 @@ WebInspector.HeapSnapshotPaddingNode.prototype = {
|
| /**
|
| * @constructor
|
| * @extends {WebInspector.HeapSnapshotSortableDataGrid}
|
| + * @param {!WebInspector.ProfilesPanel} panel
|
| * @param {!Array.<!WebInspector.DataGrid.ColumnDescriptor>=} columns
|
| */
|
| -WebInspector.HeapSnapshotContainmentDataGrid = function(columns)
|
| +WebInspector.HeapSnapshotContainmentDataGrid = function(panel, columns)
|
| {
|
| columns = columns || [
|
| {id: "object", title: WebInspector.UIString("Object"), disclosure: true, sortable: true},
|
| @@ -616,7 +630,7 @@ WebInspector.HeapSnapshotContainmentDataGrid = function(columns)
|
| {id: "shallowSize", title: WebInspector.UIString("Shallow Size"), width: "120px", sortable: true},
|
| {id: "retainedSize", title: WebInspector.UIString("Retained Size"), width: "120px", sortable: true, sort: WebInspector.DataGrid.Order.Descending}
|
| ];
|
| - WebInspector.HeapSnapshotSortableDataGrid.call(this, columns);
|
| + WebInspector.HeapSnapshotSortableDataGrid.call(this, panel, columns);
|
| }
|
|
|
| WebInspector.HeapSnapshotContainmentDataGrid.prototype = {
|
| @@ -652,8 +666,9 @@ WebInspector.HeapSnapshotContainmentDataGrid.prototype = {
|
| /**
|
| * @constructor
|
| * @extends {WebInspector.HeapSnapshotContainmentDataGrid}
|
| + * @param {!WebInspector.ProfilesPanel} panel
|
| */
|
| -WebInspector.HeapSnapshotRetainmentDataGrid = function()
|
| +WebInspector.HeapSnapshotRetainmentDataGrid = function(panel)
|
| {
|
| var columns = [
|
| {id: "object", title: WebInspector.UIString("Object"), disclosure: true, sortable: true},
|
| @@ -661,7 +676,7 @@ WebInspector.HeapSnapshotRetainmentDataGrid = function()
|
| {id: "shallowSize", title: WebInspector.UIString("Shallow Size"), width: "120px", sortable: true},
|
| {id: "retainedSize", title: WebInspector.UIString("Retained Size"), width: "120px", sortable: true}
|
| ];
|
| - WebInspector.HeapSnapshotContainmentDataGrid.call(this, columns);
|
| + WebInspector.HeapSnapshotContainmentDataGrid.call(this, panel, columns);
|
| }
|
|
|
| WebInspector.HeapSnapshotRetainmentDataGrid.Events = {
|
| @@ -707,8 +722,9 @@ WebInspector.HeapSnapshotRetainmentDataGrid.prototype = {
|
| /**
|
| * @constructor
|
| * @extends {WebInspector.HeapSnapshotViewportDataGrid}
|
| + * @param {!WebInspector.ProfilesPanel} panel
|
| */
|
| -WebInspector.HeapSnapshotConstructorsDataGrid = function()
|
| +WebInspector.HeapSnapshotConstructorsDataGrid = function(panel)
|
| {
|
| var columns = [
|
| {id: "object", title: WebInspector.UIString("Constructor"), disclosure: true, sortable: true},
|
| @@ -717,7 +733,7 @@ WebInspector.HeapSnapshotConstructorsDataGrid = function()
|
| {id: "shallowSize", title: WebInspector.UIString("Shallow Size"), width: "120px", sortable: true},
|
| {id: "retainedSize", title: WebInspector.UIString("Retained Size"), width: "120px", sort: WebInspector.DataGrid.Order.Descending, sortable: true}
|
| ];
|
| - WebInspector.HeapSnapshotViewportDataGrid.call(this, columns);
|
| + WebInspector.HeapSnapshotViewportDataGrid.call(this, panel, columns);
|
| this._profileIndex = -1;
|
|
|
| this._objectIdToSelect = null;
|
| @@ -865,8 +881,9 @@ WebInspector.HeapSnapshotConstructorsDataGrid.prototype = {
|
| /**
|
| * @constructor
|
| * @extends {WebInspector.HeapSnapshotViewportDataGrid}
|
| + * @param {!WebInspector.ProfilesPanel} panel
|
| */
|
| -WebInspector.HeapSnapshotDiffDataGrid = function()
|
| +WebInspector.HeapSnapshotDiffDataGrid = function(panel)
|
| {
|
| var columns = [
|
| {id: "object", title: WebInspector.UIString("Constructor"), disclosure: true, sortable: true},
|
| @@ -877,7 +894,7 @@ WebInspector.HeapSnapshotDiffDataGrid = function()
|
| {id: "removedSize", title: WebInspector.UIString("Freed Size"), width: "72px", sortable: true},
|
| {id: "sizeDelta", title: WebInspector.UIString("Size Delta"), width: "72px", sortable: true}
|
| ];
|
| - WebInspector.HeapSnapshotViewportDataGrid.call(this, columns);
|
| + WebInspector.HeapSnapshotViewportDataGrid.call(this, panel, columns);
|
| }
|
|
|
| WebInspector.HeapSnapshotDiffDataGrid.prototype = {
|
| @@ -957,15 +974,16 @@ WebInspector.HeapSnapshotDiffDataGrid.prototype = {
|
| /**
|
| * @constructor
|
| * @extends {WebInspector.HeapSnapshotSortableDataGrid}
|
| + * @param {!WebInspector.ProfilesPanel} panel
|
| */
|
| -WebInspector.HeapSnapshotDominatorsDataGrid = function()
|
| +WebInspector.HeapSnapshotDominatorsDataGrid = function(panel)
|
| {
|
| var columns = [
|
| {id: "object", title: WebInspector.UIString("Object"), disclosure: true, sortable: true},
|
| {id: "shallowSize", title: WebInspector.UIString("Shallow Size"), width: "120px", sortable: true},
|
| {id: "retainedSize", title: WebInspector.UIString("Retained Size"), width: "120px", sort: WebInspector.DataGrid.Order.Descending, sortable: true}
|
| ];
|
| - WebInspector.HeapSnapshotSortableDataGrid.call(this, columns);
|
| + WebInspector.HeapSnapshotSortableDataGrid.call(this, panel, columns);
|
| this._objectIdToSelect = null;
|
| }
|
|
|
| @@ -1055,8 +1073,9 @@ WebInspector.HeapSnapshotDominatorsDataGrid.prototype = {
|
| /**
|
| * @constructor
|
| * @extends {WebInspector.HeapSnapshotViewportDataGrid}
|
| + * @param {!WebInspector.ProfilesPanel} panel
|
| */
|
| -WebInspector.AllocationDataGrid = function()
|
| +WebInspector.AllocationDataGrid = function(panel)
|
| {
|
| var columns = [
|
| {id: "liveCount", title: WebInspector.UIString("Live Count"), width: "72px", sortable: true},
|
| @@ -1065,7 +1084,7 @@ WebInspector.AllocationDataGrid = function()
|
| {id: "size", title: WebInspector.UIString("Size"), width: "72px", sortable: true, sort: WebInspector.DataGrid.Order.Descending},
|
| {id: "name", title: WebInspector.UIString("Function"), disclosure: true, sortable: true},
|
| ];
|
| - WebInspector.HeapSnapshotViewportDataGrid.call(this, columns);
|
| + WebInspector.HeapSnapshotViewportDataGrid.call(this, panel, columns);
|
| this._linkifier = new WebInspector.Linkifier();
|
| }
|
|
|
|
|