OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 this._diffDataGrid.addEventListener(WebInspector.DataGrid.Events.SelectedNod
e, this._selectionChanged, this); | 72 this._diffDataGrid.addEventListener(WebInspector.DataGrid.Events.SelectedNod
e, this._selectionChanged, this); |
73 | 73 |
74 this._dominatorView = new WebInspector.VBox(); | 74 this._dominatorView = new WebInspector.VBox(); |
75 this._dominatorDataGrid = new WebInspector.HeapSnapshotDominatorsDataGrid(); | 75 this._dominatorDataGrid = new WebInspector.HeapSnapshotDominatorsDataGrid(); |
76 this._dominatorDataGrid.show(this._dominatorView.element); | 76 this._dominatorDataGrid.show(this._dominatorView.element); |
77 this._dominatorDataGrid.addEventListener(WebInspector.DataGrid.Events.Select
edNode, this._selectionChanged, this); | 77 this._dominatorDataGrid.addEventListener(WebInspector.DataGrid.Events.Select
edNode, this._selectionChanged, this); |
78 | 78 |
79 if (WebInspector.experimentsSettings.allocationProfiler.isEnabled() && profi
le.profileType() === WebInspector.ProfileTypeRegistry.instance.trackingHeapSnaps
hotProfileType) { | 79 if (WebInspector.experimentsSettings.allocationProfiler.isEnabled() && profi
le.profileType() === WebInspector.ProfileTypeRegistry.instance.trackingHeapSnaps
hotProfileType) { |
80 this._allocationView = new WebInspector.VBox(); | 80 this._allocationView = new WebInspector.VBox(); |
81 this._allocationDataGrid = new WebInspector.AllocationDataGrid(); | 81 this._allocationDataGrid = new WebInspector.AllocationDataGrid(); |
| 82 this._allocationDataGrid.addEventListener(WebInspector.DataGrid.Events.S
electedNode, this._onSelectAllocationNode, this); |
82 this._allocationDataGrid.show(this._allocationView.element); | 83 this._allocationDataGrid.show(this._allocationView.element); |
83 } | 84 } |
84 | 85 |
85 this._retainmentViewHeader = document.createElementWithClass("div", "retaine
rs-view-header"); | 86 this._retainmentViewHeader = document.createElementWithClass("div", "retaine
rs-view-header"); |
86 var retainingPathsTitleDiv = this._retainmentViewHeader.createChild("div", "
title"); | 87 var retainingPathsTitleDiv = this._retainmentViewHeader.createChild("div", "
title"); |
87 var retainingPathsTitle = retainingPathsTitleDiv.createChild("span"); | 88 var retainingPathsTitle = retainingPathsTitleDiv.createChild("span"); |
88 retainingPathsTitle.textContent = WebInspector.UIString("Object's retaining
tree"); | 89 retainingPathsTitle.textContent = WebInspector.UIString("Object's retaining
tree"); |
89 this._splitView.hideDefaultResizer(); | 90 this._splitView.hideDefaultResizer(); |
90 this._splitView.installResizer(this._retainmentViewHeader); | 91 this._splitView.installResizer(this._retainmentViewHeader); |
91 | 92 |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 __proto__: WebInspector.HeapSnapshotView.Perspective.prototype | 362 __proto__: WebInspector.HeapSnapshotView.Perspective.prototype |
362 } | 363 } |
363 | 364 |
364 /** | 365 /** |
365 * @constructor | 366 * @constructor |
366 * @extends {WebInspector.HeapSnapshotView.Perspective} | 367 * @extends {WebInspector.HeapSnapshotView.Perspective} |
367 */ | 368 */ |
368 WebInspector.HeapSnapshotView.AllocationPerspective = function() | 369 WebInspector.HeapSnapshotView.AllocationPerspective = function() |
369 { | 370 { |
370 WebInspector.HeapSnapshotView.Perspective.call(this, WebInspector.UIString(
"Allocation")); | 371 WebInspector.HeapSnapshotView.Perspective.call(this, WebInspector.UIString(
"Allocation")); |
| 372 this._allocationSplitView = new WebInspector.SplitView(false, true, "heapSna
pshotAllocationSplitViewState", 200, 200); |
| 373 this._allocationSplitView.setMainElementConstraints(50, 100); |
| 374 this._allocationSplitView.setSidebarElementConstraints(50, 100); |
371 } | 375 } |
372 | 376 |
373 WebInspector.HeapSnapshotView.AllocationPerspective.prototype = { | 377 WebInspector.HeapSnapshotView.AllocationPerspective.prototype = { |
374 /** | 378 /** |
375 * @override | 379 * @override |
376 * @param {!WebInspector.HeapSnapshotView} heapSnapshotView | 380 * @param {!WebInspector.HeapSnapshotView} heapSnapshotView |
377 */ | 381 */ |
378 activate: function(heapSnapshotView) | 382 activate: function(heapSnapshotView) |
379 { | 383 { |
380 heapSnapshotView._allocationView.show(heapSnapshotView.element); | 384 heapSnapshotView._allocationView.show(this._allocationSplitView.mainElem
ent()); |
| 385 heapSnapshotView._constructorsView.show(heapSnapshotView._splitView.main
Element()); |
| 386 heapSnapshotView._retainmentView.show(heapSnapshotView._splitView.sideba
rElement()); |
| 387 heapSnapshotView._splitView.show(this._allocationSplitView.sidebarElemen
t()); |
| 388 this._allocationSplitView.show(heapSnapshotView.element); |
381 }, | 389 }, |
382 | 390 |
383 /** | 391 /** |
| 392 * @override |
| 393 * @param {!WebInspector.HeapSnapshotView} heapSnapshotView |
| 394 */ |
| 395 deactivate: function(heapSnapshotView) |
| 396 { |
| 397 this._allocationSplitView.detach(); |
| 398 WebInspector.HeapSnapshotView.Perspective.prototype.deactivate.call(this
, heapSnapshotView); |
| 399 }, |
| 400 |
| 401 /** |
384 * @override | 402 * @override |
385 * @param {!WebInspector.HeapSnapshotView} heapSnapshotView | 403 * @param {!WebInspector.HeapSnapshotView} heapSnapshotView |
386 * @return {?WebInspector.DataGrid} | 404 * @return {?WebInspector.DataGrid} |
387 */ | 405 */ |
388 masterGrid: function(heapSnapshotView) | 406 masterGrid: function(heapSnapshotView) |
389 { | 407 { |
390 return heapSnapshotView._allocationDataGrid; | 408 return heapSnapshotView._allocationDataGrid; |
391 }, | 409 }, |
392 | 410 |
393 __proto__: WebInspector.HeapSnapshotView.Perspective.prototype | 411 __proto__: WebInspector.HeapSnapshotView.Perspective.prototype |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
734 this._dataGrid.populateContextMenu(contextMenu, event); | 752 this._dataGrid.populateContextMenu(contextMenu, event); |
735 }, | 753 }, |
736 | 754 |
737 _selectionChanged: function(event) | 755 _selectionChanged: function(event) |
738 { | 756 { |
739 var selectedNode = event.target.selectedNode; | 757 var selectedNode = event.target.selectedNode; |
740 this._setRetainmentDataGridSource(selectedNode); | 758 this._setRetainmentDataGridSource(selectedNode); |
741 this._inspectedObjectChanged(event); | 759 this._inspectedObjectChanged(event); |
742 }, | 760 }, |
743 | 761 |
| 762 _onSelectAllocationNode: function(event) |
| 763 { |
| 764 var selectedNode = event.target.selectedNode; |
| 765 this._constructorsDataGrid.setAllocationNodeId(selectedNode.allocationNo
deId()); |
| 766 }, |
| 767 |
744 _inspectedObjectChanged: function(event) | 768 _inspectedObjectChanged: function(event) |
745 { | 769 { |
746 var selectedNode = event.target.selectedNode; | 770 var selectedNode = event.target.selectedNode; |
747 if (!this._profile.fromFile() && selectedNode instanceof WebInspector.He
apSnapshotGenericObjectNode) | 771 if (!this._profile.fromFile() && selectedNode instanceof WebInspector.He
apSnapshotGenericObjectNode) |
748 ConsoleAgent.addInspectedHeapObject(selectedNode.snapshotNodeId); | 772 ConsoleAgent.addInspectedHeapObject(selectedNode.snapshotNodeId); |
749 }, | 773 }, |
750 | 774 |
751 _setRetainmentDataGridSource: function(nodeItem) | 775 _setRetainmentDataGridSource: function(nodeItem) |
752 { | 776 { |
753 if (nodeItem && nodeItem.snapshotNodeIndex) | 777 if (nodeItem && nodeItem.snapshotNodeIndex) |
(...skipping 1376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2130 if (color) | 2154 if (color) |
2131 swatchDiv.style.backgroundColor = color; | 2155 swatchDiv.style.backgroundColor = color; |
2132 else | 2156 else |
2133 swatchDiv.classList.add("heap-snapshot-stats-empty-swatch"); | 2157 swatchDiv.classList.add("heap-snapshot-stats-empty-swatch"); |
2134 nameDiv.textContent = name; | 2158 nameDiv.textContent = name; |
2135 sizeDiv.textContent = WebInspector.UIString("%s KB", Number.withThousand
sSeparator(Math.round(value / 1024))); | 2159 sizeDiv.textContent = WebInspector.UIString("%s KB", Number.withThousand
sSeparator(Math.round(value / 1024))); |
2136 }, | 2160 }, |
2137 | 2161 |
2138 __proto__: WebInspector.VBox.prototype | 2162 __proto__: WebInspector.VBox.prototype |
2139 } | 2163 } |
OLD | NEW |