| 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 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1218 /** | 1219 /** |
| 1219 * @param {?string} error | 1220 * @param {?string} error |
| 1220 * @this {WebInspector.HeapSnapshotProfileType} | 1221 * @this {WebInspector.HeapSnapshotProfileType} |
| 1221 */ | 1222 */ |
| 1222 function didTakeHeapSnapshot(error) | 1223 function didTakeHeapSnapshot(error) |
| 1223 { | 1224 { |
| 1224 var profile = this._profileBeingRecorded; | 1225 var profile = this._profileBeingRecorded; |
| 1225 profile.title = WebInspector.UIString("Snapshot %d", profile.uid); | 1226 profile.title = WebInspector.UIString("Snapshot %d", profile.uid); |
| 1226 profile._finishLoad(); | 1227 profile._finishLoad(); |
| 1227 this._profileBeingRecorded = null; | 1228 this._profileBeingRecorded = null; |
| 1228 WebInspector.panels.profiles.showProfile(profile); | 1229 this.dispatchEventToListeners(WebInspector.ProfileType.Events.Profil
eComplete, profile); |
| 1229 callback(); | 1230 callback(); |
| 1230 } | 1231 } |
| 1231 HeapProfilerAgent.takeHeapSnapshot(true, didTakeHeapSnapshot.bind(this))
; | 1232 HeapProfilerAgent.takeHeapSnapshot(true, didTakeHeapSnapshot.bind(this))
; |
| 1232 }, | 1233 }, |
| 1233 | 1234 |
| 1234 /** | 1235 /** |
| 1235 * @override | 1236 * @override |
| 1236 * @param {string} chunk | 1237 * @param {string} chunk |
| 1237 */ | 1238 */ |
| 1238 addHeapSnapshotChunk: function(chunk) | 1239 addHeapSnapshotChunk: function(chunk) |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1407 function didTakeHeapSnapshot(error) | 1408 function didTakeHeapSnapshot(error) |
| 1408 { | 1409 { |
| 1409 var target = /** @type {!WebInspector.Target} */ (WebInspector.targe
tManager.activeTarget()); | 1410 var target = /** @type {!WebInspector.Target} */ (WebInspector.targe
tManager.activeTarget()); |
| 1410 target.profilingLock.release(); | 1411 target.profilingLock.release(); |
| 1411 var profile = this._profileBeingRecorded; | 1412 var profile = this._profileBeingRecorded; |
| 1412 if (!profile) | 1413 if (!profile) |
| 1413 return; | 1414 return; |
| 1414 profile._finishLoad(); | 1415 profile._finishLoad(); |
| 1415 this._profileSamples = null; | 1416 this._profileSamples = null; |
| 1416 this._profileBeingRecorded = null; | 1417 this._profileBeingRecorded = null; |
| 1417 WebInspector.panels.profiles.showProfile(profile); | 1418 this.dispatchEventToListeners(WebInspector.ProfileType.Events.Profil
eComplete, profile); |
| 1418 } | 1419 } |
| 1419 | 1420 |
| 1420 HeapProfilerAgent.stopTrackingHeapObjects(true, didTakeHeapSnapshot.bind
(this)); | 1421 HeapProfilerAgent.stopTrackingHeapObjects(true, didTakeHeapSnapshot.bind
(this)); |
| 1421 this._recording = false; | 1422 this._recording = false; |
| 1422 this.dispatchEventToListeners(WebInspector.TrackingHeapSnapshotProfileTy
pe.TrackingStopped); | 1423 this.dispatchEventToListeners(WebInspector.TrackingHeapSnapshotProfileTy
pe.TrackingStopped); |
| 1423 }, | 1424 }, |
| 1424 | 1425 |
| 1425 _toggleRecording: function() | 1426 _toggleRecording: function() |
| 1426 { | 1427 { |
| 1427 if (this._recording) | 1428 if (this._recording) |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1495 * @type {?Array.<function(!WebInspector.HeapSnapshotProxy)>} | 1496 * @type {?Array.<function(!WebInspector.HeapSnapshotProxy)>} |
| 1496 */ | 1497 */ |
| 1497 this._loadCallbacks = []; | 1498 this._loadCallbacks = []; |
| 1498 this._totalNumberOfChunks = 0; | 1499 this._totalNumberOfChunks = 0; |
| 1499 this._bufferedWriter = null; | 1500 this._bufferedWriter = null; |
| 1500 } | 1501 } |
| 1501 | 1502 |
| 1502 WebInspector.HeapProfileHeader.prototype = { | 1503 WebInspector.HeapProfileHeader.prototype = { |
| 1503 /** | 1504 /** |
| 1504 * @override | 1505 * @override |
| 1506 * @param {!WebInspector.ProfileType.DataDisplayDelegate} dataDisplayDelegat
e |
| 1505 * @return {!WebInspector.ProfileSidebarTreeElement} | 1507 * @return {!WebInspector.ProfileSidebarTreeElement} |
| 1506 */ | 1508 */ |
| 1507 createSidebarTreeElement: function() | 1509 createSidebarTreeElement: function(dataDisplayDelegate) |
| 1508 { | 1510 { |
| 1509 return new WebInspector.ProfileSidebarTreeElement(this, "heap-snapshot-s
idebar-tree-item"); | 1511 return new WebInspector.ProfileSidebarTreeElement(dataDisplayDelegate, t
his, "heap-snapshot-sidebar-tree-item"); |
| 1510 }, | 1512 }, |
| 1511 | 1513 |
| 1512 /** | 1514 /** |
| 1513 * @override | 1515 * @override |
| 1516 * @param {!WebInspector.ProfileType.DataDisplayDelegate} dataDisplayDelegat
e |
| 1514 * @return {!WebInspector.HeapSnapshotView} | 1517 * @return {!WebInspector.HeapSnapshotView} |
| 1515 */ | 1518 */ |
| 1516 createView: function() | 1519 createView: function(dataDisplayDelegate) |
| 1517 { | 1520 { |
| 1518 return new WebInspector.HeapSnapshotView(this); | 1521 return new WebInspector.HeapSnapshotView(dataDisplayDelegate, this); |
| 1519 }, | 1522 }, |
| 1520 | 1523 |
| 1521 /** | 1524 /** |
| 1522 * @override | 1525 * @override |
| 1523 * @param {function(!WebInspector.HeapSnapshotProxy):void} callback | 1526 * @param {function(!WebInspector.HeapSnapshotProxy):void} callback |
| 1524 */ | 1527 */ |
| 1525 load: function(callback) | 1528 load: function(callback) |
| 1526 { | 1529 { |
| 1527 if (this.uid === -1) | 1530 if (this.uid === -1) |
| 1528 return; | 1531 return; |
| (...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2270 urlElement = this._linkifier.linkifyRawLocation(rawLocation)
; | 2273 urlElement = this._linkifier.linkifyRawLocation(rawLocation)
; |
| 2271 if (!urlElement) | 2274 if (!urlElement) |
| 2272 urlElement = this._linkifier.linkifyLocation(this._target, f
rame.scriptName, frame.line - 1, frame.column - 1); | 2275 urlElement = this._linkifier.linkifyLocation(this._target, f
rame.scriptName, frame.line - 1, frame.column - 1); |
| 2273 frameDiv.appendChild(urlElement); | 2276 frameDiv.appendChild(urlElement); |
| 2274 } | 2277 } |
| 2275 } | 2278 } |
| 2276 }, | 2279 }, |
| 2277 | 2280 |
| 2278 __proto__: WebInspector.View.prototype | 2281 __proto__: WebInspector.View.prototype |
| 2279 } | 2282 } |
| OLD | NEW |