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

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

Issue 2623743002: DevTools: extract modules (non-extensions) (Closed)
Patch Set: rebaseline Created 3 years, 11 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 13 matching lines...) Expand all
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 * @unrestricted 32 * @unrestricted
33 */ 33 */
34 Profiler.HeapSnapshotGridNode = class extends UI.DataGridNode { 34 Profiler.HeapSnapshotGridNode = class extends DataGrid.DataGridNode {
35 /** 35 /**
36 * @param {!Profiler.HeapSnapshotSortableDataGrid} tree 36 * @param {!Profiler.HeapSnapshotSortableDataGrid} tree
37 * @param {boolean} hasChildren 37 * @param {boolean} hasChildren
38 */ 38 */
39 constructor(tree, hasChildren) { 39 constructor(tree, hasChildren) {
40 super(null, hasChildren); 40 super(null, hasChildren);
41 this._dataGrid = tree; 41 this._dataGrid = tree;
42 this._instanceCount = 0; 42 this._instanceCount = 0;
43 43
44 this._savedChildren = null; 44 this._savedChildren = null;
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 /** 157 /**
158 * @param {number} distance 158 * @param {number} distance
159 * @return {string} 159 * @return {string}
160 */ 160 */
161 _toUIDistance(distance) { 161 _toUIDistance(distance) {
162 var baseSystemDistance = Profiler.HeapSnapshotCommon.baseSystemDistance; 162 var baseSystemDistance = Profiler.HeapSnapshotCommon.baseSystemDistance;
163 return distance >= 0 && distance < baseSystemDistance ? Common.UIString('%d' , distance) : Common.UIString('\u2212'); 163 return distance >= 0 && distance < baseSystemDistance ? Common.UIString('%d' , distance) : Common.UIString('\u2212');
164 } 164 }
165 165
166 /** 166 /**
167 * @return {!Array.<!UI.DataGridNode>} 167 * @return {!Array.<!DataGrid.DataGridNode>}
168 */ 168 */
169 allChildren() { 169 allChildren() {
170 return this._dataGrid.allChildren(this); 170 return this._dataGrid.allChildren(this);
171 } 171 }
172 172
173 /** 173 /**
174 * @param {number} index 174 * @param {number} index
175 */ 175 */
176 removeChildByIndex(index) { 176 removeChildByIndex(index) {
177 this._dataGrid.removeChildByIndex(this, index); 177 this._dataGrid.removeChildByIndex(this, index);
178 } 178 }
179 179
180 /** 180 /**
181 * @param {number} nodePosition 181 * @param {number} nodePosition
182 * @return {?UI.DataGridNode} 182 * @return {?DataGrid.DataGridNode}
183 */ 183 */
184 childForPosition(nodePosition) { 184 childForPosition(nodePosition) {
185 var indexOfFirstChildInRange = 0; 185 var indexOfFirstChildInRange = 0;
186 for (var i = 0; i < this._retrievedChildrenRanges.length; i++) { 186 for (var i = 0; i < this._retrievedChildrenRanges.length; i++) {
187 var range = this._retrievedChildrenRanges[i]; 187 var range = this._retrievedChildrenRanges[i];
188 if (range.from <= nodePosition && nodePosition < range.to) { 188 if (range.from <= nodePosition && nodePosition < range.to) {
189 var childIndex = indexOfFirstChildInRange + nodePosition - range.from; 189 var childIndex = indexOfFirstChildInRange + nodePosition - range.from;
190 return this.allChildren()[childIndex]; 190 return this.allChildren()[childIndex];
191 } 191 }
192 indexOfFirstChildInRange += range.to - range.from + 1; 192 indexOfFirstChildInRange += range.to - range.from + 1;
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 return; 271 return;
272 } 272 }
273 } 273 }
274 this._dataGrid.insertChild(this, this._createChildNode(item), insertionInd ex); 274 this._dataGrid.insertChild(this, this._createChildNode(item), insertionInd ex);
275 } 275 }
276 276
277 /** 277 /**
278 * @this {Profiler.HeapSnapshotGridNode} 278 * @this {Profiler.HeapSnapshotGridNode}
279 */ 279 */
280 function insertShowMoreButton(from, to, insertionIndex) { 280 function insertShowMoreButton(from, to, insertionIndex) {
281 var button = new UI.ShowMoreDataGridNode( 281 var button = new DataGrid.ShowMoreDataGridNode(
282 this._populateChildren.bind(this), from, to, this._dataGrid.defaultPop ulateCount()); 282 this._populateChildren.bind(this), from, to, this._dataGrid.defaultPop ulateCount());
283 this._dataGrid.insertChild(this, button, insertionIndex); 283 this._dataGrid.insertChild(this, button, insertionIndex);
284 } 284 }
285 285
286 /** 286 /**
287 * @param {!Profiler.HeapSnapshotCommon.ItemsRange} itemsRange 287 * @param {!Profiler.HeapSnapshotCommon.ItemsRange} itemsRange
288 * @this {Profiler.HeapSnapshotGridNode} 288 * @this {Profiler.HeapSnapshotGridNode}
289 */ 289 */
290 function childrenRetrieved(itemsRange) { 290 function childrenRetrieved(itemsRange) {
291 var itemIndex = 0; 291 var itemIndex = 0;
(...skipping 1148 matching lines...) Expand 10 before | Expand all | Expand 10 after
1440 return cell; 1440 return cell;
1441 } 1441 }
1442 1442
1443 /** 1443 /**
1444 * @return {number} 1444 * @return {number}
1445 */ 1445 */
1446 allocationNodeId() { 1446 allocationNodeId() {
1447 return this._allocationNode.id; 1447 return this._allocationNode.id;
1448 } 1448 }
1449 }; 1449 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698