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

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

Issue 388303002: DevTools: Get rid of WebInspector.TargetObserver (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 this._diffView = new WebInspector.VBox(); 69 this._diffView = new WebInspector.VBox();
70 this._diffView.setMinimumSize(50, 25); 70 this._diffView.setMinimumSize(50, 25);
71 71
72 this._diffDataGrid = new WebInspector.HeapSnapshotDiffDataGrid(dataDisplayDe legate); 72 this._diffDataGrid = new WebInspector.HeapSnapshotDiffDataGrid(dataDisplayDe legate);
73 this._diffDataGrid.show(this._diffView.element); 73 this._diffDataGrid.show(this._diffView.element);
74 this._diffDataGrid.addEventListener(WebInspector.DataGrid.Events.SelectedNod e, this._selectionChanged, this); 74 this._diffDataGrid.addEventListener(WebInspector.DataGrid.Events.SelectedNod e, this._selectionChanged, this);
75 75
76 if (profile._hasAllocationStacks) { 76 if (profile._hasAllocationStacks) {
77 this._allocationView = new WebInspector.VBox(); 77 this._allocationView = new WebInspector.VBox();
78 this._allocationView.setMinimumSize(50, 25); 78 this._allocationView.setMinimumSize(50, 25);
79 this._allocationDataGrid = new WebInspector.AllocationDataGrid(profile.t arget() , dataDisplayDelegate); 79 this._allocationDataGrid = new WebInspector.AllocationDataGrid(profile.w eakTarget() , dataDisplayDelegate);
80 this._allocationDataGrid.addEventListener(WebInspector.DataGrid.Events.S electedNode, this._onSelectAllocationNode, this); 80 this._allocationDataGrid.addEventListener(WebInspector.DataGrid.Events.S electedNode, this._onSelectAllocationNode, this);
81 this._allocationDataGrid.show(this._allocationView.element); 81 this._allocationDataGrid.show(this._allocationView.element);
82 82
83 this._allocationStackView = new WebInspector.HeapAllocationStackView(pro file.target()); 83 this._allocationStackView = new WebInspector.HeapAllocationStackView(pro file.weakTarget());
84 this._allocationStackView.setMinimumSize(50, 25); 84 this._allocationStackView.setMinimumSize(50, 25);
85 85
86 this._tabbedPane = new WebInspector.TabbedPane(); 86 this._tabbedPane = new WebInspector.TabbedPane();
87 this._tabbedPane.closeableTabs = false; 87 this._tabbedPane.closeableTabs = false;
88 this._tabbedPane.headerElement().classList.add("heap-object-details-head er"); 88 this._tabbedPane.headerElement().classList.add("heap-object-details-head er");
89 } 89 }
90 90
91 this._retainmentView = new WebInspector.VBox(); 91 this._retainmentView = new WebInspector.VBox();
92 this._retainmentView.setMinimumSize(50, 21); 92 this._retainmentView.setMinimumSize(50, 21);
93 this._retainmentView.element.classList.add("retaining-paths-view"); 93 this._retainmentView.element.classList.add("retaining-paths-view");
(...skipping 2027 matching lines...) Expand 10 before | Expand all | Expand 10 after
2121 nameDiv.textContent = name; 2121 nameDiv.textContent = name;
2122 sizeDiv.textContent = WebInspector.UIString("%s KB", Number.withThousand sSeparator(Math.round(value / 1024))); 2122 sizeDiv.textContent = WebInspector.UIString("%s KB", Number.withThousand sSeparator(Math.round(value / 1024)));
2123 }, 2123 },
2124 2124
2125 __proto__: WebInspector.VBox.prototype 2125 __proto__: WebInspector.VBox.prototype
2126 } 2126 }
2127 2127
2128 /** 2128 /**
2129 * @constructor 2129 * @constructor
2130 * @extends {WebInspector.View} 2130 * @extends {WebInspector.View}
2131 * @param {?WebInspector.Target} target 2131 * @param {!WeakReference.<!WebInspector.Target>} weakTarget
2132 */ 2132 */
2133 WebInspector.HeapAllocationStackView = function(target) 2133 WebInspector.HeapAllocationStackView = function(weakTarget)
2134 { 2134 {
2135 WebInspector.View.call(this); 2135 WebInspector.View.call(this);
2136 this._targetObserver = new WebInspector.TargetObserver(target); 2136 this._weakTarget = weakTarget;;
2137 this._linkifier = new WebInspector.Linkifier(); 2137 this._linkifier = new WebInspector.Linkifier();
2138 } 2138 }
2139 2139
2140 WebInspector.HeapAllocationStackView.prototype = { 2140 WebInspector.HeapAllocationStackView.prototype = {
2141 /** 2141 /**
2142 * @param {!WebInspector.HeapSnapshotProxy} snapshot 2142 * @param {!WebInspector.HeapSnapshotProxy} snapshot
2143 * @param {number} snapshotNodeIndex 2143 * @param {number} snapshotNodeIndex
2144 */ 2144 */
2145 setAllocatedObject: function(snapshot, snapshotNodeIndex) 2145 setAllocatedObject: function(snapshot, snapshotNodeIndex)
2146 { 2146 {
(...skipping 18 matching lines...) Expand all
2165 return; 2165 return;
2166 } 2166 }
2167 2167
2168 var stackDiv = this.element.createChild("div", "heap-allocation-stack"); 2168 var stackDiv = this.element.createChild("div", "heap-allocation-stack");
2169 for (var i = 0; i < frames.length; i++) { 2169 for (var i = 0; i < frames.length; i++) {
2170 var frame = frames[i]; 2170 var frame = frames[i];
2171 var frameDiv = stackDiv.createChild("div", "stack-frame"); 2171 var frameDiv = stackDiv.createChild("div", "stack-frame");
2172 var name = frameDiv.createChild("div"); 2172 var name = frameDiv.createChild("div");
2173 name.textContent = frame.functionName; 2173 name.textContent = frame.functionName;
2174 if (frame.scriptId) { 2174 if (frame.scriptId) {
2175 var urlElement = this._linkifier.linkifyLocationByScriptId(this. _targetObserver.target(), String(frame.scriptId), frame.scriptName, frame.line - 1, frame.column - 1); 2175 var urlElement = this._linkifier.linkifyLocationByScriptId(this. _weakTarget.get(), String(frame.scriptId), frame.scriptName, frame.line - 1, fra me.column - 1);
2176 frameDiv.appendChild(urlElement); 2176 frameDiv.appendChild(urlElement);
2177 } 2177 }
2178 } 2178 }
2179 }, 2179 },
2180 2180
2181 __proto__: WebInspector.View.prototype 2181 __proto__: WebInspector.View.prototype
2182 } 2182 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/profiler/HeapSnapshotDataGrids.js ('k') | Source/devtools/front_end/profiler/ProfilesPanel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698