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 14 matching lines...) Expand all Loading... |
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 * @implements {WebInspector.ProfileType.DataDisplayDelegate} | 33 * @implements {WebInspector.ProfileType.DataDisplayDelegate} |
34 * @implements {WebInspector.Searchable} | 34 * @implements {WebInspector.Searchable} |
35 * @extends {WebInspector.VBox} | 35 * @extends {WebInspector.VBoxWithToolbarItems} |
36 * @param {!WebInspector.ProfileType.DataDisplayDelegate} dataDisplayDelegate | 36 * @param {!WebInspector.ProfileType.DataDisplayDelegate} dataDisplayDelegate |
37 * @param {!WebInspector.HeapProfileHeader} profile | 37 * @param {!WebInspector.HeapProfileHeader} profile |
38 */ | 38 */ |
39 WebInspector.HeapSnapshotView = function(dataDisplayDelegate, profile) | 39 WebInspector.HeapSnapshotView = function(dataDisplayDelegate, profile) |
40 { | 40 { |
41 WebInspector.VBox.call(this); | 41 WebInspector.VBoxWithToolbarItems.call(this); |
42 | 42 |
43 this.element.classList.add("heap-snapshot-view"); | 43 this.element.classList.add("heap-snapshot-view"); |
44 | 44 |
45 profile.profileType().addEventListener(WebInspector.HeapSnapshotProfileType.
SnapshotReceived, this._onReceiveSnapshot, this); | 45 profile.profileType().addEventListener(WebInspector.HeapSnapshotProfileType.
SnapshotReceived, this._onReceiveSnapshot, this); |
46 profile.profileType().addEventListener(WebInspector.ProfileType.Events.Remov
eProfileHeader, this._onProfileHeaderRemoved, this); | 46 profile.profileType().addEventListener(WebInspector.ProfileType.Events.Remov
eProfileHeader, this._onProfileHeaderRemoved, this); |
47 | 47 |
48 var isHeapTimeline = profile.profileType().id === WebInspector.TrackingHeapS
napshotProfileType.TypeId; | 48 var isHeapTimeline = profile.profileType().id === WebInspector.TrackingHeapS
napshotProfileType.TypeId; |
49 if (isHeapTimeline) { | 49 if (isHeapTimeline) { |
50 this._trackingOverviewGrid = new WebInspector.HeapTrackingOverviewGrid(p
rofile); | 50 this._trackingOverviewGrid = new WebInspector.HeapTrackingOverviewGrid(p
rofile); |
51 this._trackingOverviewGrid.addEventListener(WebInspector.HeapTrackingOve
rviewGrid.IdsRangeChanged, this._onIdsRangeChanged.bind(this)); | 51 this._trackingOverviewGrid.addEventListener(WebInspector.HeapTrackingOve
rviewGrid.IdsRangeChanged, this._onIdsRangeChanged.bind(this)); |
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 _onIdsRangeChanged: function(event) | 516 _onIdsRangeChanged: function(event) |
517 { | 517 { |
518 var minId = event.data.minId; | 518 var minId = event.data.minId; |
519 var maxId = event.data.maxId; | 519 var maxId = event.data.maxId; |
520 this._selectedSizeText.setText(WebInspector.UIString("Selected size: %s"
, Number.bytesToString(event.data.size))); | 520 this._selectedSizeText.setText(WebInspector.UIString("Selected size: %s"
, Number.bytesToString(event.data.size))); |
521 if (this._constructorsDataGrid.snapshot) | 521 if (this._constructorsDataGrid.snapshot) |
522 this._constructorsDataGrid.setSelectionRange(minId, maxId); | 522 this._constructorsDataGrid.setSelectionRange(minId, maxId); |
523 }, | 523 }, |
524 | 524 |
525 /** | 525 /** |
| 526 * @override |
526 * @return {!Array.<!WebInspector.ToolbarItem>} | 527 * @return {!Array.<!WebInspector.ToolbarItem>} |
527 */ | 528 */ |
528 toolbarItems: function() | 529 toolbarItems: function() |
529 { | 530 { |
530 var result = [this._perspectiveSelect, this._classNameFilter]; | 531 var result = [this._perspectiveSelect, this._classNameFilter]; |
531 if (this._profile.profileType() !== WebInspector.ProfileTypeRegistry.ins
tance.trackingHeapSnapshotProfileType) | 532 if (this._profile.profileType() !== WebInspector.ProfileTypeRegistry.ins
tance.trackingHeapSnapshotProfileType) |
532 result.push(this._baseSelect, this._filterSelect); | 533 result.push(this._baseSelect, this._filterSelect); |
533 result.push(this._selectedSizeText); | 534 result.push(this._selectedSizeText); |
534 return result; | 535 return result; |
535 }, | 536 }, |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1003 dispose: function() | 1004 dispose: function() |
1004 { | 1005 { |
1005 if (this._allocationStackView) { | 1006 if (this._allocationStackView) { |
1006 this._allocationStackView.clear(); | 1007 this._allocationStackView.clear(); |
1007 this._allocationDataGrid.dispose(); | 1008 this._allocationDataGrid.dispose(); |
1008 } | 1009 } |
1009 if (this._trackingOverviewGrid) | 1010 if (this._trackingOverviewGrid) |
1010 this._trackingOverviewGrid.dispose(); | 1011 this._trackingOverviewGrid.dispose(); |
1011 }, | 1012 }, |
1012 | 1013 |
1013 __proto__: WebInspector.VBox.prototype | 1014 __proto__: WebInspector.VBoxWithToolbarItems.prototype |
1014 } | 1015 } |
1015 | 1016 |
1016 /** | 1017 /** |
1017 * @constructor | 1018 * @constructor |
1018 * @extends {WebInspector.ProfileType} | 1019 * @extends {WebInspector.ProfileType} |
1019 * @implements {WebInspector.TargetManager.Observer} | 1020 * @implements {WebInspector.TargetManager.Observer} |
1020 * @param {string=} id | 1021 * @param {string=} id |
1021 * @param {string=} title | 1022 * @param {string=} title |
1022 */ | 1023 */ |
1023 WebInspector.HeapSnapshotProfileType = function(id, title) | 1024 WebInspector.HeapSnapshotProfileType = function(id, title) |
(...skipping 1225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2249 name.textContent = WebInspector.beautifyFunctionName(frame.functionN
ame); | 2250 name.textContent = WebInspector.beautifyFunctionName(frame.functionN
ame); |
2250 if (frame.scriptId) { | 2251 if (frame.scriptId) { |
2251 var urlElement = this._linkifier.linkifyScriptLocation(this._tar
get, String(frame.scriptId), frame.scriptName, frame.line - 1, frame.column - 1)
; | 2252 var urlElement = this._linkifier.linkifyScriptLocation(this._tar
get, String(frame.scriptId), frame.scriptName, frame.line - 1, frame.column - 1)
; |
2252 frameDiv.appendChild(urlElement); | 2253 frameDiv.appendChild(urlElement); |
2253 } | 2254 } |
2254 } | 2255 } |
2255 }, | 2256 }, |
2256 | 2257 |
2257 __proto__: WebInspector.Widget.prototype | 2258 __proto__: WebInspector.Widget.prototype |
2258 } | 2259 } |
OLD | NEW |