Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(114)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/profiler/HeapSnapshotView.js

Issue 2217783002: DevTools: use view locations in the elements and sources sidebars. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: for landing Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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.View} 35 * @extends {WebInspector.SimpleView}
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.View.call(this, WebInspector.UIString("Heap Snapshot")); 41 WebInspector.SimpleView.call(this, WebInspector.UIString("Heap Snapshot"));
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 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 * @override
527 * @return {!Array.<!WebInspector.ToolbarItem>} 527 * @return {!Array.<!WebInspector.ToolbarItem>}
528 */ 528 */
529 toolbarItems: function() 529 syncToolbarItems: function()
530 { 530 {
531 var result = [this._perspectiveSelect, this._classNameFilter]; 531 var result = [this._perspectiveSelect, this._classNameFilter];
532 if (this._profile.profileType() !== WebInspector.ProfileTypeRegistry.ins tance.trackingHeapSnapshotProfileType) 532 if (this._profile.profileType() !== WebInspector.ProfileTypeRegistry.ins tance.trackingHeapSnapshotProfileType)
533 result.push(this._baseSelect, this._filterSelect); 533 result.push(this._baseSelect, this._filterSelect);
534 result.push(this._selectedSizeText); 534 result.push(this._selectedSizeText);
535 return result; 535 return result;
536 }, 536 },
537 537
538 /** 538 /**
539 * @override 539 * @override
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
1004 dispose: function() 1004 dispose: function()
1005 { 1005 {
1006 if (this._allocationStackView) { 1006 if (this._allocationStackView) {
1007 this._allocationStackView.clear(); 1007 this._allocationStackView.clear();
1008 this._allocationDataGrid.dispose(); 1008 this._allocationDataGrid.dispose();
1009 } 1009 }
1010 if (this._trackingOverviewGrid) 1010 if (this._trackingOverviewGrid)
1011 this._trackingOverviewGrid.dispose(); 1011 this._trackingOverviewGrid.dispose();
1012 }, 1012 },
1013 1013
1014 __proto__: WebInspector.View.prototype 1014 __proto__: WebInspector.SimpleView.prototype
1015 } 1015 }
1016 1016
1017 /** 1017 /**
1018 * @constructor 1018 * @constructor
1019 * @extends {WebInspector.ProfileType} 1019 * @extends {WebInspector.ProfileType}
1020 * @implements {WebInspector.TargetManager.Observer} 1020 * @implements {WebInspector.TargetManager.Observer}
1021 * @param {string=} id 1021 * @param {string=} id
1022 * @param {string=} title 1022 * @param {string=} title
1023 */ 1023 */
1024 WebInspector.HeapSnapshotProfileType = function(id, title) 1024 WebInspector.HeapSnapshotProfileType = function(id, title)
(...skipping 1225 matching lines...) Expand 10 before | Expand all | Expand 10 after
2250 name.textContent = WebInspector.beautifyFunctionName(frame.functionN ame); 2250 name.textContent = WebInspector.beautifyFunctionName(frame.functionN ame);
2251 if (frame.scriptId) { 2251 if (frame.scriptId) {
2252 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) ;
2253 frameDiv.appendChild(urlElement); 2253 frameDiv.appendChild(urlElement);
2254 } 2254 }
2255 } 2255 }
2256 }, 2256 },
2257 2257
2258 __proto__: WebInspector.Widget.prototype 2258 __proto__: WebInspector.Widget.prototype
2259 } 2259 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698