| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 */ | 42 */ |
| 43 WebInspector.HeapSnapshotView = function(dataDisplayDelegate, profile) | 43 WebInspector.HeapSnapshotView = function(dataDisplayDelegate, profile) |
| 44 { | 44 { |
| 45 WebInspector.VBox.call(this); | 45 WebInspector.VBox.call(this); |
| 46 | 46 |
| 47 this.element.classList.add("heap-snapshot-view"); | 47 this.element.classList.add("heap-snapshot-view"); |
| 48 | 48 |
| 49 profile.profileType().addEventListener(WebInspector.HeapSnapshotProfileType.
SnapshotReceived, this._onReceiveSnapshot, this); | 49 profile.profileType().addEventListener(WebInspector.HeapSnapshotProfileType.
SnapshotReceived, this._onReceiveSnapshot, this); |
| 50 profile.profileType().addEventListener(WebInspector.ProfileType.Events.Remov
eProfileHeader, this._onProfileHeaderRemoved, this); | 50 profile.profileType().addEventListener(WebInspector.ProfileType.Events.Remov
eProfileHeader, this._onProfileHeaderRemoved, this); |
| 51 | 51 |
| 52 if (profile._profileType.id === WebInspector.TrackingHeapSnapshotProfileType
.TypeId) { | 52 if (profile.profileType().id === WebInspector.TrackingHeapSnapshotProfileTyp
e.TypeId) { |
| 53 this._trackingOverviewGrid = new WebInspector.HeapTrackingOverviewGrid(p
rofile); | 53 this._trackingOverviewGrid = new WebInspector.HeapTrackingOverviewGrid(p
rofile); |
| 54 this._trackingOverviewGrid.addEventListener(WebInspector.HeapTrackingOve
rviewGrid.IdsRangeChanged, this._onIdsRangeChanged.bind(this)); | 54 this._trackingOverviewGrid.addEventListener(WebInspector.HeapTrackingOve
rviewGrid.IdsRangeChanged, this._onIdsRangeChanged.bind(this)); |
| 55 } | 55 } |
| 56 | 56 |
| 57 this._splitView = new WebInspector.SplitView(false, true, "heapSnapshotSplit
ViewState", 200, 200); | 57 this._splitView = new WebInspector.SplitView(false, true, "heapSnapshotSplit
ViewState", 200, 200); |
| 58 this._splitView.show(this.element); | 58 this._splitView.show(this.element); |
| 59 | 59 |
| 60 this._containmentView = new WebInspector.VBox(); | 60 this._containmentView = new WebInspector.VBox(); |
| 61 this._containmentView.setMinimumSize(50, 25); | 61 this._containmentView.setMinimumSize(50, 25); |
| 62 this._containmentDataGrid = new WebInspector.HeapSnapshotContainmentDataGrid
(dataDisplayDelegate); | 62 this._containmentDataGrid = new WebInspector.HeapSnapshotContainmentDataGrid
(dataDisplayDelegate); |
| (...skipping 1304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1367 | 1367 |
| 1368 _stopRecordingProfile: function() | 1368 _stopRecordingProfile: function() |
| 1369 { | 1369 { |
| 1370 this._profileBeingRecorded.updateStatus(WebInspector.UIString("Snapshott
ing\u2026")); | 1370 this._profileBeingRecorded.updateStatus(WebInspector.UIString("Snapshott
ing\u2026")); |
| 1371 /** | 1371 /** |
| 1372 * @param {?string} error | 1372 * @param {?string} error |
| 1373 * @this {WebInspector.HeapSnapshotProfileType} | 1373 * @this {WebInspector.HeapSnapshotProfileType} |
| 1374 */ | 1374 */ |
| 1375 function didTakeHeapSnapshot(error) | 1375 function didTakeHeapSnapshot(error) |
| 1376 { | 1376 { |
| 1377 var profile = this._profileBeingRecorded; | 1377 var profile = this.profileBeingRecorded(); |
| 1378 if (!profile) | 1378 if (!profile) |
| 1379 return; | 1379 return; |
| 1380 profile._finishLoad(); | 1380 profile._finishLoad(); |
| 1381 this._profileSamples = null; | 1381 this._profileSamples = null; |
| 1382 this.setProfileBeingRecorded(null); | 1382 this.setProfileBeingRecorded(null); |
| 1383 this.dispatchEventToListeners(WebInspector.ProfileType.Events.Profil
eComplete, profile); | 1383 this.dispatchEventToListeners(WebInspector.ProfileType.Events.Profil
eComplete, profile); |
| 1384 } | 1384 } |
| 1385 | 1385 |
| 1386 HeapProfilerAgent.stopTrackingHeapObjects(true, didTakeHeapSnapshot.bind
(this)); | 1386 HeapProfilerAgent.stopTrackingHeapObjects(true, didTakeHeapSnapshot.bind
(this)); |
| 1387 this._recording = false; | 1387 this._recording = false; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1438 /** | 1438 /** |
| 1439 * @constructor | 1439 * @constructor |
| 1440 * @extends {WebInspector.ProfileHeader} | 1440 * @extends {WebInspector.ProfileHeader} |
| 1441 * @param {!WebInspector.Target} target | 1441 * @param {!WebInspector.Target} target |
| 1442 * @param {!WebInspector.HeapSnapshotProfileType} type | 1442 * @param {!WebInspector.HeapSnapshotProfileType} type |
| 1443 * @param {string=} title | 1443 * @param {string=} title |
| 1444 * @param {boolean=} hasAllocationStacks | 1444 * @param {boolean=} hasAllocationStacks |
| 1445 */ | 1445 */ |
| 1446 WebInspector.HeapProfileHeader = function(target, type, title, hasAllocationStac
ks) | 1446 WebInspector.HeapProfileHeader = function(target, type, title, hasAllocationStac
ks) |
| 1447 { | 1447 { |
| 1448 WebInspector.ProfileHeader.call(this, target, type, title || WebInspector.UI
String("Snapshot %d", type._nextProfileUid)); | 1448 WebInspector.ProfileHeader.call(this, target, type, title || WebInspector.UI
String("Snapshot %d", type.nextProfileUid())); |
| 1449 this._hasAllocationStacks = !!hasAllocationStacks; | 1449 this._hasAllocationStacks = !!hasAllocationStacks; |
| 1450 this.maxJSObjectId = -1; | 1450 this.maxJSObjectId = -1; |
| 1451 /** | 1451 /** |
| 1452 * @type {?WebInspector.HeapSnapshotWorkerProxy} | 1452 * @type {?WebInspector.HeapSnapshotWorkerProxy} |
| 1453 */ | 1453 */ |
| 1454 this._workerProxy = null; | 1454 this._workerProxy = null; |
| 1455 /** | 1455 /** |
| 1456 * @type {?WebInspector.OutputStream} | 1456 * @type {?WebInspector.OutputStream} |
| 1457 */ | 1457 */ |
| 1458 this._receiver = null; | 1458 this._receiver = null; |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1792 this._overviewGrid = new WebInspector.OverviewGrid("heap-recording"); | 1792 this._overviewGrid = new WebInspector.OverviewGrid("heap-recording"); |
| 1793 this._overviewGrid.element.classList.add("fill"); | 1793 this._overviewGrid.element.classList.add("fill"); |
| 1794 | 1794 |
| 1795 this._overviewCanvas = this._overviewContainer.createChild("canvas", "heap-r
ecording-overview-canvas"); | 1795 this._overviewCanvas = this._overviewContainer.createChild("canvas", "heap-r
ecording-overview-canvas"); |
| 1796 this._overviewContainer.appendChild(this._overviewGrid.element); | 1796 this._overviewContainer.appendChild(this._overviewGrid.element); |
| 1797 this._overviewCalculator = new WebInspector.HeapTrackingOverviewGrid.Overvie
wCalculator(); | 1797 this._overviewCalculator = new WebInspector.HeapTrackingOverviewGrid.Overvie
wCalculator(); |
| 1798 this._overviewGrid.addEventListener(WebInspector.OverviewGrid.Events.WindowC
hanged, this._onWindowChanged, this); | 1798 this._overviewGrid.addEventListener(WebInspector.OverviewGrid.Events.WindowC
hanged, this._onWindowChanged, this); |
| 1799 | 1799 |
| 1800 this._profileSamples = heapProfileHeader._profileSamples; | 1800 this._profileSamples = heapProfileHeader._profileSamples; |
| 1801 if (heapProfileHeader.profileType().profileBeingRecorded() === heapProfileHe
ader) { | 1801 if (heapProfileHeader.profileType().profileBeingRecorded() === heapProfileHe
ader) { |
| 1802 this._profileType = heapProfileHeader._profileType; | 1802 this._profileType = heapProfileHeader.profileType(); |
| 1803 this._profileType.addEventListener(WebInspector.TrackingHeapSnapshotProf
ileType.HeapStatsUpdate, this._onHeapStatsUpdate, this); | 1803 this._profileType.addEventListener(WebInspector.TrackingHeapSnapshotProf
ileType.HeapStatsUpdate, this._onHeapStatsUpdate, this); |
| 1804 this._profileType.addEventListener(WebInspector.TrackingHeapSnapshotProf
ileType.TrackingStopped, this._onStopTracking, this); | 1804 this._profileType.addEventListener(WebInspector.TrackingHeapSnapshotProf
ileType.TrackingStopped, this._onStopTracking, this); |
| 1805 } | 1805 } |
| 1806 var timestamps = this._profileSamples.timestamps; | 1806 var timestamps = this._profileSamples.timestamps; |
| 1807 var totalTime = this._profileSamples.totalTime; | 1807 var totalTime = this._profileSamples.totalTime; |
| 1808 this._windowLeft = 0.0; | 1808 this._windowLeft = 0.0; |
| 1809 this._windowRight = totalTime && timestamps.length ? (timestamps[timestamps.
length - 1] - timestamps[0]) / totalTime : 1.0; | 1809 this._windowRight = totalTime && timestamps.length ? (timestamps[timestamps.
length - 1] - timestamps[0]) / totalTime : 1.0; |
| 1810 this._overviewGrid.setWindow(this._windowLeft, this._windowRight); | 1810 this._overviewGrid.setWindow(this._windowLeft, this._windowRight); |
| 1811 this._yScale = new WebInspector.HeapTrackingOverviewGrid.SmoothScale(); | 1811 this._yScale = new WebInspector.HeapTrackingOverviewGrid.SmoothScale(); |
| 1812 this._xScale = new WebInspector.HeapTrackingOverviewGrid.SmoothScale(); | 1812 this._xScale = new WebInspector.HeapTrackingOverviewGrid.SmoothScale(); |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2241 urlElement = this._linkifier.linkifyRawLocation(rawLocation)
; | 2241 urlElement = this._linkifier.linkifyRawLocation(rawLocation)
; |
| 2242 if (!urlElement) | 2242 if (!urlElement) |
| 2243 urlElement = this._linkifier.linkifyLocation(this._target, f
rame.scriptName, frame.line - 1, frame.column - 1); | 2243 urlElement = this._linkifier.linkifyLocation(this._target, f
rame.scriptName, frame.line - 1, frame.column - 1); |
| 2244 frameDiv.appendChild(urlElement); | 2244 frameDiv.appendChild(urlElement); |
| 2245 } | 2245 } |
| 2246 } | 2246 } |
| 2247 }, | 2247 }, |
| 2248 | 2248 |
| 2249 __proto__: WebInspector.View.prototype | 2249 __proto__: WebInspector.View.prototype |
| 2250 } | 2250 } |
| OLD | NEW |