| 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 13 matching lines...) Expand all Loading... |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 /** | 31 /** |
| 32 * @constructor | 32 * @constructor |
| 33 * @extends {WebInspector.VBox} | 33 * @extends {WebInspector.VBox} |
| 34 * @param {!WebInspector.ProfileType.DataDisplayDelegate} dataDisplayDelegate |
| 34 * @param {!WebInspector.HeapProfileHeader} profile | 35 * @param {!WebInspector.HeapProfileHeader} profile |
| 35 */ | 36 */ |
| 36 WebInspector.HeapSnapshotView = function(profile) | 37 WebInspector.HeapSnapshotView = function(dataDisplayDelegate, profile) |
| 37 { | 38 { |
| 38 WebInspector.VBox.call(this); | 39 WebInspector.VBox.call(this); |
| 39 | 40 |
| 40 this.element.classList.add("heap-snapshot-view"); | 41 this.element.classList.add("heap-snapshot-view"); |
| 41 | 42 |
| 42 profile.profileType().addEventListener(WebInspector.HeapSnapshotProfileType.
SnapshotReceived, this._onReceiveSnapshot, this); | 43 profile.profileType().addEventListener(WebInspector.HeapSnapshotProfileType.
SnapshotReceived, this._onReceiveSnapshot, this); |
| 43 profile.profileType().addEventListener(WebInspector.ProfileType.Events.Remov
eProfileHeader, this._onProfileHeaderRemoved, this); | 44 profile.profileType().addEventListener(WebInspector.ProfileType.Events.Remov
eProfileHeader, this._onProfileHeaderRemoved, this); |
| 44 | 45 |
| 45 if (profile._profileType.id === WebInspector.TrackingHeapSnapshotProfileType
.TypeId) { | 46 if (profile._profileType.id === WebInspector.TrackingHeapSnapshotProfileType
.TypeId) { |
| 46 this._trackingOverviewGrid = new WebInspector.HeapTrackingOverviewGrid(p
rofile); | 47 this._trackingOverviewGrid = new WebInspector.HeapTrackingOverviewGrid(p
rofile); |
| 47 this._trackingOverviewGrid.addEventListener(WebInspector.HeapTrackingOve
rviewGrid.IdsRangeChanged, this._onIdsRangeChanged.bind(this)); | 48 this._trackingOverviewGrid.addEventListener(WebInspector.HeapTrackingOve
rviewGrid.IdsRangeChanged, this._onIdsRangeChanged.bind(this)); |
| 48 } | 49 } |
| 49 | 50 |
| 50 this._splitView = new WebInspector.SplitView(false, true, "heapSnapshotSplit
ViewState", 200, 200); | 51 this._splitView = new WebInspector.SplitView(false, true, "heapSnapshotSplit
ViewState", 200, 200); |
| 51 this._splitView.show(this.element); | 52 this._splitView.show(this.element); |
| 52 | 53 |
| 53 this._containmentView = new WebInspector.VBox(); | 54 this._containmentView = new WebInspector.VBox(); |
| 54 this._containmentView.setMinimumSize(50, 25); | 55 this._containmentView.setMinimumSize(50, 25); |
| 55 this._containmentDataGrid = new WebInspector.HeapSnapshotContainmentDataGrid
(); | 56 this._containmentDataGrid = new WebInspector.HeapSnapshotContainmentDataGrid
(dataDisplayDelegate); |
| 56 this._containmentDataGrid.show(this._containmentView.element); | 57 this._containmentDataGrid.show(this._containmentView.element); |
| 57 this._containmentDataGrid.addEventListener(WebInspector.DataGrid.Events.Sele
ctedNode, this._selectionChanged, this); | 58 this._containmentDataGrid.addEventListener(WebInspector.DataGrid.Events.Sele
ctedNode, this._selectionChanged, this); |
| 58 | 59 |
| 59 this._statisticsView = new WebInspector.HeapSnapshotStatisticsView(); | 60 this._statisticsView = new WebInspector.HeapSnapshotStatisticsView(); |
| 60 | 61 |
| 61 this._constructorsView = new WebInspector.VBox(); | 62 this._constructorsView = new WebInspector.VBox(); |
| 62 this._constructorsView.setMinimumSize(50, 25); | 63 this._constructorsView.setMinimumSize(50, 25); |
| 63 | 64 |
| 64 this._constructorsDataGrid = new WebInspector.HeapSnapshotConstructorsDataGr
id(); | 65 this._constructorsDataGrid = new WebInspector.HeapSnapshotConstructorsDataGr
id(dataDisplayDelegate); |
| 65 this._constructorsDataGrid.show(this._constructorsView.element); | 66 this._constructorsDataGrid.show(this._constructorsView.element); |
| 66 this._constructorsDataGrid.addEventListener(WebInspector.DataGrid.Events.Sel
ectedNode, this._selectionChanged, this); | 67 this._constructorsDataGrid.addEventListener(WebInspector.DataGrid.Events.Sel
ectedNode, this._selectionChanged, this); |
| 67 | 68 |
| 68 this._diffView = new WebInspector.VBox(); | 69 this._diffView = new WebInspector.VBox(); |
| 69 this._diffView.setMinimumSize(50, 25); | 70 this._diffView.setMinimumSize(50, 25); |
| 70 | 71 |
| 71 this._diffDataGrid = new WebInspector.HeapSnapshotDiffDataGrid(); | 72 this._diffDataGrid = new WebInspector.HeapSnapshotDiffDataGrid(dataDisplayDe
legate); |
| 72 this._diffDataGrid.show(this._diffView.element); | 73 this._diffDataGrid.show(this._diffView.element); |
| 73 this._diffDataGrid.addEventListener(WebInspector.DataGrid.Events.SelectedNod
e, this._selectionChanged, this); | 74 this._diffDataGrid.addEventListener(WebInspector.DataGrid.Events.SelectedNod
e, this._selectionChanged, this); |
| 74 | 75 |
| 75 this._dominatorView = new WebInspector.VBox(); | 76 this._dominatorView = new WebInspector.VBox(); |
| 76 this._dominatorView.setMinimumSize(50, 25); | 77 this._dominatorView.setMinimumSize(50, 25); |
| 77 this._dominatorDataGrid = new WebInspector.HeapSnapshotDominatorsDataGrid(); | 78 this._dominatorDataGrid = new WebInspector.HeapSnapshotDominatorsDataGrid(da
taDisplayDelegate); |
| 78 this._dominatorDataGrid.show(this._dominatorView.element); | 79 this._dominatorDataGrid.show(this._dominatorView.element); |
| 79 this._dominatorDataGrid.addEventListener(WebInspector.DataGrid.Events.Select
edNode, this._selectionChanged, this); | 80 this._dominatorDataGrid.addEventListener(WebInspector.DataGrid.Events.Select
edNode, this._selectionChanged, this); |
| 80 | 81 |
| 81 if (WebInspector.experimentsSettings.allocationProfiler.isEnabled() && profi
le.profileType() === WebInspector.ProfileTypeRegistry.instance.trackingHeapSnaps
hotProfileType) { | 82 if (WebInspector.experimentsSettings.allocationProfiler.isEnabled() && profi
le.profileType() === WebInspector.ProfileTypeRegistry.instance.trackingHeapSnaps
hotProfileType) { |
| 82 this._allocationView = new WebInspector.VBox(); | 83 this._allocationView = new WebInspector.VBox(); |
| 83 this._allocationView.setMinimumSize(50, 25); | 84 this._allocationView.setMinimumSize(50, 25); |
| 84 this._allocationDataGrid = new WebInspector.AllocationDataGrid(); | 85 this._allocationDataGrid = new WebInspector.AllocationDataGrid(dataDispl
ayDelegate); |
| 85 this._allocationDataGrid.addEventListener(WebInspector.DataGrid.Events.S
electedNode, this._onSelectAllocationNode, this); | 86 this._allocationDataGrid.addEventListener(WebInspector.DataGrid.Events.S
electedNode, this._onSelectAllocationNode, this); |
| 86 this._allocationDataGrid.show(this._allocationView.element); | 87 this._allocationDataGrid.show(this._allocationView.element); |
| 87 | 88 |
| 88 this._allocationStackView = new WebInspector.HeapAllocationStackView(); | 89 this._allocationStackView = new WebInspector.HeapAllocationStackView(); |
| 89 this._allocationStackView.setMinimumSize(50, 25); | 90 this._allocationStackView.setMinimumSize(50, 25); |
| 90 | 91 |
| 91 this._tabbedPane = new WebInspector.TabbedPane(); | 92 this._tabbedPane = new WebInspector.TabbedPane(); |
| 92 this._tabbedPane.closeableTabs = false; | 93 this._tabbedPane.closeableTabs = false; |
| 93 this._tabbedPane.headerElement().classList.add("heap-object-details-head
er"); | 94 this._tabbedPane.headerElement().classList.add("heap-object-details-head
er"); |
| 94 } | 95 } |
| (...skipping 19 matching lines...) Expand all Loading... |
| 114 var retainingPathsTitle = retainingPathsTitleDiv.createChild("span"); | 115 var retainingPathsTitle = retainingPathsTitleDiv.createChild("span"); |
| 115 retainingPathsTitle.textContent = WebInspector.UIString("Retainers"); | 116 retainingPathsTitle.textContent = WebInspector.UIString("Retainers"); |
| 116 this._retainmentView.element.appendChild(retainmentViewHeader); | 117 this._retainmentView.element.appendChild(retainmentViewHeader); |
| 117 | 118 |
| 118 splitViewResizer = retainmentViewHeader; | 119 splitViewResizer = retainmentViewHeader; |
| 119 this._objectDetailsView = this._retainmentView; | 120 this._objectDetailsView = this._retainmentView; |
| 120 } | 121 } |
| 121 this._splitView.hideDefaultResizer(); | 122 this._splitView.hideDefaultResizer(); |
| 122 this._splitView.installResizer(splitViewResizer); | 123 this._splitView.installResizer(splitViewResizer); |
| 123 | 124 |
| 124 this._retainmentDataGrid = new WebInspector.HeapSnapshotRetainmentDataGrid()
; | 125 this._retainmentDataGrid = new WebInspector.HeapSnapshotRetainmentDataGrid(d
ataDisplayDelegate); |
| 125 this._retainmentDataGrid.show(this._retainmentView.element); | 126 this._retainmentDataGrid.show(this._retainmentView.element); |
| 126 this._retainmentDataGrid.addEventListener(WebInspector.DataGrid.Events.Selec
tedNode, this._inspectedObjectChanged, this); | 127 this._retainmentDataGrid.addEventListener(WebInspector.DataGrid.Events.Selec
tedNode, this._inspectedObjectChanged, this); |
| 127 this._retainmentDataGrid.reset(); | 128 this._retainmentDataGrid.reset(); |
| 128 | 129 |
| 129 this._perspectives = []; | 130 this._perspectives = []; |
| 130 this._perspectives.push(new WebInspector.HeapSnapshotView.SummaryPerspective
()); | 131 this._perspectives.push(new WebInspector.HeapSnapshotView.SummaryPerspective
()); |
| 131 if (profile.profileType() !== WebInspector.ProfileTypeRegistry.instance.trac
kingHeapSnapshotProfileType) | 132 if (profile.profileType() !== WebInspector.ProfileTypeRegistry.instance.trac
kingHeapSnapshotProfileType) |
| 132 this._perspectives.push(new WebInspector.HeapSnapshotView.ComparisonPers
pective()); | 133 this._perspectives.push(new WebInspector.HeapSnapshotView.ComparisonPers
pective()); |
| 133 this._perspectives.push(new WebInspector.HeapSnapshotView.ContainmentPerspec
tive()); | 134 this._perspectives.push(new WebInspector.HeapSnapshotView.ContainmentPerspec
tive()); |
| 134 if (WebInspector.settings.showAdvancedHeapSnapshotProperties.get()) | 135 if (WebInspector.settings.showAdvancedHeapSnapshotProperties.get()) |
| (...skipping 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1219 /** | 1220 /** |
| 1220 * @param {?string} error | 1221 * @param {?string} error |
| 1221 * @this {WebInspector.HeapSnapshotProfileType} | 1222 * @this {WebInspector.HeapSnapshotProfileType} |
| 1222 */ | 1223 */ |
| 1223 function didTakeHeapSnapshot(error) | 1224 function didTakeHeapSnapshot(error) |
| 1224 { | 1225 { |
| 1225 var profile = this._profileBeingRecorded; | 1226 var profile = this._profileBeingRecorded; |
| 1226 profile.title = WebInspector.UIString("Snapshot %d", profile.uid); | 1227 profile.title = WebInspector.UIString("Snapshot %d", profile.uid); |
| 1227 profile._finishLoad(); | 1228 profile._finishLoad(); |
| 1228 this.setProfileBeingRecorded(null); | 1229 this.setProfileBeingRecorded(null); |
| 1229 WebInspector.panels.profiles.showProfile(profile); | 1230 this.dispatchEventToListeners(WebInspector.ProfileType.Events.Profil
eComplete, profile); |
| 1230 callback(); | 1231 callback(); |
| 1231 } | 1232 } |
| 1232 HeapProfilerAgent.takeHeapSnapshot(true, didTakeHeapSnapshot.bind(this))
; | 1233 HeapProfilerAgent.takeHeapSnapshot(true, didTakeHeapSnapshot.bind(this))
; |
| 1233 }, | 1234 }, |
| 1234 | 1235 |
| 1235 /** | 1236 /** |
| 1236 * @override | 1237 * @override |
| 1237 * @param {string} chunk | 1238 * @param {string} chunk |
| 1238 */ | 1239 */ |
| 1239 addHeapSnapshotChunk: function(chunk) | 1240 addHeapSnapshotChunk: function(chunk) |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1404 * @this {WebInspector.HeapSnapshotProfileType} | 1405 * @this {WebInspector.HeapSnapshotProfileType} |
| 1405 */ | 1406 */ |
| 1406 function didTakeHeapSnapshot(error) | 1407 function didTakeHeapSnapshot(error) |
| 1407 { | 1408 { |
| 1408 var profile = this._profileBeingRecorded; | 1409 var profile = this._profileBeingRecorded; |
| 1409 if (!profile) | 1410 if (!profile) |
| 1410 return; | 1411 return; |
| 1411 profile._finishLoad(); | 1412 profile._finishLoad(); |
| 1412 this._profileSamples = null; | 1413 this._profileSamples = null; |
| 1413 this.setProfileBeingRecorded(null); | 1414 this.setProfileBeingRecorded(null); |
| 1414 WebInspector.panels.profiles.showProfile(profile); | 1415 this.dispatchEventToListeners(WebInspector.ProfileType.Events.Profil
eComplete, profile); |
| 1415 } | 1416 } |
| 1416 | 1417 |
| 1417 HeapProfilerAgent.stopTrackingHeapObjects(true, didTakeHeapSnapshot.bind
(this)); | 1418 HeapProfilerAgent.stopTrackingHeapObjects(true, didTakeHeapSnapshot.bind
(this)); |
| 1418 this._recording = false; | 1419 this._recording = false; |
| 1419 this.dispatchEventToListeners(WebInspector.TrackingHeapSnapshotProfileTy
pe.TrackingStopped); | 1420 this.dispatchEventToListeners(WebInspector.TrackingHeapSnapshotProfileTy
pe.TrackingStopped); |
| 1420 }, | 1421 }, |
| 1421 | 1422 |
| 1422 _toggleRecording: function() | 1423 _toggleRecording: function() |
| 1423 { | 1424 { |
| 1424 if (this._recording) | 1425 if (this._recording) |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1492 * @type {?Array.<function(!WebInspector.HeapSnapshotProxy)>} | 1493 * @type {?Array.<function(!WebInspector.HeapSnapshotProxy)>} |
| 1493 */ | 1494 */ |
| 1494 this._loadCallbacks = []; | 1495 this._loadCallbacks = []; |
| 1495 this._totalNumberOfChunks = 0; | 1496 this._totalNumberOfChunks = 0; |
| 1496 this._bufferedWriter = null; | 1497 this._bufferedWriter = null; |
| 1497 } | 1498 } |
| 1498 | 1499 |
| 1499 WebInspector.HeapProfileHeader.prototype = { | 1500 WebInspector.HeapProfileHeader.prototype = { |
| 1500 /** | 1501 /** |
| 1501 * @override | 1502 * @override |
| 1503 * @param {!WebInspector.ProfileType.DataDisplayDelegate} dataDisplayDelegat
e |
| 1502 * @return {!WebInspector.ProfileSidebarTreeElement} | 1504 * @return {!WebInspector.ProfileSidebarTreeElement} |
| 1503 */ | 1505 */ |
| 1504 createSidebarTreeElement: function() | 1506 createSidebarTreeElement: function(dataDisplayDelegate) |
| 1505 { | 1507 { |
| 1506 return new WebInspector.ProfileSidebarTreeElement(this, "heap-snapshot-s
idebar-tree-item"); | 1508 return new WebInspector.ProfileSidebarTreeElement(dataDisplayDelegate, t
his, "heap-snapshot-sidebar-tree-item"); |
| 1507 }, | 1509 }, |
| 1508 | 1510 |
| 1509 /** | 1511 /** |
| 1510 * @override | 1512 * @override |
| 1513 * @param {!WebInspector.ProfileType.DataDisplayDelegate} dataDisplayDelegat
e |
| 1511 * @return {!WebInspector.HeapSnapshotView} | 1514 * @return {!WebInspector.HeapSnapshotView} |
| 1512 */ | 1515 */ |
| 1513 createView: function() | 1516 createView: function(dataDisplayDelegate) |
| 1514 { | 1517 { |
| 1515 return new WebInspector.HeapSnapshotView(this); | 1518 return new WebInspector.HeapSnapshotView(dataDisplayDelegate, this); |
| 1516 }, | 1519 }, |
| 1517 | 1520 |
| 1518 /** | 1521 /** |
| 1519 * @override | 1522 * @override |
| 1520 * @param {function(!WebInspector.HeapSnapshotProxy):void} callback | 1523 * @param {function(!WebInspector.HeapSnapshotProxy):void} callback |
| 1521 */ | 1524 */ |
| 1522 load: function(callback) | 1525 load: function(callback) |
| 1523 { | 1526 { |
| 1524 if (this.uid === -1) | 1527 if (this.uid === -1) |
| 1525 return; | 1528 return; |
| (...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2267 urlElement = this._linkifier.linkifyRawLocation(rawLocation)
; | 2270 urlElement = this._linkifier.linkifyRawLocation(rawLocation)
; |
| 2268 if (!urlElement) | 2271 if (!urlElement) |
| 2269 urlElement = this._linkifier.linkifyLocation(this._target, f
rame.scriptName, frame.line - 1, frame.column - 1); | 2272 urlElement = this._linkifier.linkifyLocation(this._target, f
rame.scriptName, frame.line - 1, frame.column - 1); |
| 2270 frameDiv.appendChild(urlElement); | 2273 frameDiv.appendChild(urlElement); |
| 2271 } | 2274 } |
| 2272 } | 2275 } |
| 2273 }, | 2276 }, |
| 2274 | 2277 |
| 2275 __proto__: WebInspector.View.prototype | 2278 __proto__: WebInspector.View.prototype |
| 2276 } | 2279 } |
| OLD | NEW |