| 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 */ | 97 */ |
| 98 collapse: function() | 98 collapse: function() |
| 99 { | 99 { |
| 100 WebInspector.DataGridNode.prototype.collapse.call(this); | 100 WebInspector.DataGridNode.prototype.collapse.call(this); |
| 101 this._dataGrid.updateVisibleNodes(); | 101 this._dataGrid.updateVisibleNodes(); |
| 102 }, | 102 }, |
| 103 | 103 |
| 104 /** | 104 /** |
| 105 * @override | 105 * @override |
| 106 */ | 106 */ |
| 107 expand: function() |
| 108 { |
| 109 WebInspector.DataGridNode.prototype.expand.call(this); |
| 110 this._dataGrid.updateVisibleNodes(); |
| 111 }, |
| 112 |
| 113 /** |
| 114 * @override |
| 115 */ |
| 107 dispose: function() | 116 dispose: function() |
| 108 { | 117 { |
| 109 if (this._providerObject) | 118 if (this._providerObject) |
| 110 this._providerObject.dispose(); | 119 this._providerObject.dispose(); |
| 111 for (var node = this.children[0]; node; node = node.traverseNextNode(tru
e, this, true)) | 120 for (var node = this.children[0]; node; node = node.traverseNextNode(tru
e, this, true)) |
| 112 if (node.dispose) | 121 if (node.dispose) |
| 113 node.dispose(); | 122 node.dispose(); |
| 114 }, | 123 }, |
| 115 | 124 |
| 116 _reachableFromWindow: false, | 125 _reachableFromWindow: false, |
| (...skipping 13 matching lines...) Expand all Loading... |
| 130 _toPercentString: function(num) | 139 _toPercentString: function(num) |
| 131 { | 140 { |
| 132 return num.toFixed(0) + "\u2009%"; // \u2009 is a thin space. | 141 return num.toFixed(0) + "\u2009%"; // \u2009 is a thin space. |
| 133 }, | 142 }, |
| 134 | 143 |
| 135 /** | 144 /** |
| 136 * @return {!Array.<!WebInspector.DataGridNode>} | 145 * @return {!Array.<!WebInspector.DataGridNode>} |
| 137 */ | 146 */ |
| 138 allChildren: function() | 147 allChildren: function() |
| 139 { | 148 { |
| 140 return this.children; | 149 return this._dataGrid.allChildren(this); |
| 141 }, | 150 }, |
| 142 | 151 |
| 143 /** | 152 /** |
| 144 * @param {number} index | 153 * @param {number} index |
| 145 */ | 154 */ |
| 146 removeChildByIndex: function(index) | 155 removeChildByIndex: function(index) |
| 147 { | 156 { |
| 148 this.removeChild(this.children[index]); | 157 this._dataGrid.removeChildByIndex(this, index); |
| 149 }, | 158 }, |
| 150 | 159 |
| 151 /** | 160 /** |
| 152 * @param {number} nodePosition | 161 * @param {number} nodePosition |
| 153 * @return {?WebInspector.DataGridNode} | 162 * @return {?WebInspector.DataGridNode} |
| 154 */ | 163 */ |
| 155 childForPosition: function(nodePosition) | 164 childForPosition: function(nodePosition) |
| 156 { | 165 { |
| 157 var indexOfFirstChildInRange = 0; | 166 var indexOfFirstChildInRange = 0; |
| 158 for (var i = 0; i < this._retrievedChildrenRanges.length; i++) { | 167 for (var i = 0; i < this._retrievedChildrenRanges.length; i++) { |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 } | 249 } |
| 241 | 250 |
| 242 /** | 251 /** |
| 243 * @this {WebInspector.HeapSnapshotGridNode} | 252 * @this {WebInspector.HeapSnapshotGridNode} |
| 244 */ | 253 */ |
| 245 function insertRetrievedChild(item, insertionIndex) | 254 function insertRetrievedChild(item, insertionIndex) |
| 246 { | 255 { |
| 247 if (this._savedChildren) { | 256 if (this._savedChildren) { |
| 248 var hash = this._childHashForEntity(item); | 257 var hash = this._childHashForEntity(item); |
| 249 if (hash in this._savedChildren) { | 258 if (hash in this._savedChildren) { |
| 250 this.insertChild(this._savedChildren[hash], insertionIndex); | 259 this._dataGrid.insertChild(this, this._savedChildren[hash],
insertionIndex); |
| 251 return; | 260 return; |
| 252 } | 261 } |
| 253 } | 262 } |
| 254 this.insertChild(this._createChildNode(item), insertionIndex); | 263 this._dataGrid.insertChild(this, this._createChildNode(item), insert
ionIndex); |
| 255 } | 264 } |
| 256 | 265 |
| 257 /** | 266 /** |
| 258 * @this {WebInspector.HeapSnapshotGridNode} | 267 * @this {WebInspector.HeapSnapshotGridNode} |
| 259 */ | 268 */ |
| 260 function insertShowMoreButton(from, to, insertionIndex) | 269 function insertShowMoreButton(from, to, insertionIndex) |
| 261 { | 270 { |
| 262 var button = new WebInspector.ShowMoreDataGridNode(this._populateChi
ldren.bind(this), from, to, this._dataGrid.defaultPopulateCount()); | 271 var button = new WebInspector.ShowMoreDataGridNode(this._populateChi
ldren.bind(this), from, to, this._dataGrid.defaultPopulateCount()); |
| 263 this.insertChild(button, insertionIndex); | 272 this._dataGrid.insertChild(this, button, insertionIndex); |
| 264 } | 273 } |
| 265 | 274 |
| 266 /** | 275 /** |
| 267 * @param {!WebInspector.HeapSnapshotCommon.ItemsRange} itemsRange | 276 * @param {!WebInspector.HeapSnapshotCommon.ItemsRange} itemsRange |
| 268 * @this {WebInspector.HeapSnapshotGridNode} | 277 * @this {WebInspector.HeapSnapshotGridNode} |
| 269 */ | 278 */ |
| 270 function childrenRetrieved(itemsRange) | 279 function childrenRetrieved(itemsRange) |
| 271 { | 280 { |
| 272 var itemIndex = 0; | 281 var itemIndex = 0; |
| 273 var itemPosition = itemsRange.startPosition; | 282 var itemPosition = itemsRange.startPosition; |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 } | 358 } |
| 350 } | 359 } |
| 351 | 360 |
| 352 // TODO: fix this. | 361 // TODO: fix this. |
| 353 this._instanceCount += items.length; | 362 this._instanceCount += items.length; |
| 354 if (firstNotSerializedPosition < toPosition) { | 363 if (firstNotSerializedPosition < toPosition) { |
| 355 serializeNextChunk.call(this); | 364 serializeNextChunk.call(this); |
| 356 return; | 365 return; |
| 357 } | 366 } |
| 358 | 367 |
| 368 this._dataGrid.updateVisibleNodes(); |
| 359 if (afterPopulate) | 369 if (afterPopulate) |
| 360 afterPopulate(); | 370 afterPopulate(); |
| 361 this.dispatchEventToListeners(WebInspector.HeapSnapshotGridNode.Even
ts.PopulateComplete); | 371 this.dispatchEventToListeners(WebInspector.HeapSnapshotGridNode.Even
ts.PopulateComplete); |
| 362 } | 372 } |
| 363 serializeNextChunk.call(this); | 373 serializeNextChunk.call(this); |
| 364 }, | 374 }, |
| 365 | 375 |
| 366 _saveChildren: function() | 376 _saveChildren: function() |
| 367 { | 377 { |
| 368 this._savedChildren = null; | 378 this._savedChildren = null; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 380 sort: function() | 390 sort: function() |
| 381 { | 391 { |
| 382 this._dataGrid.recursiveSortingEnter(); | 392 this._dataGrid.recursiveSortingEnter(); |
| 383 | 393 |
| 384 /** | 394 /** |
| 385 * @this {WebInspector.HeapSnapshotGridNode} | 395 * @this {WebInspector.HeapSnapshotGridNode} |
| 386 */ | 396 */ |
| 387 function afterSort() | 397 function afterSort() |
| 388 { | 398 { |
| 389 this._saveChildren(); | 399 this._saveChildren(); |
| 390 this.removeChildren(); | 400 this._dataGrid.removeAllChildren(this); |
| 391 this._retrievedChildrenRanges = []; | 401 this._retrievedChildrenRanges = []; |
| 392 | 402 |
| 393 /** | 403 /** |
| 394 * @this {WebInspector.HeapSnapshotGridNode} | 404 * @this {WebInspector.HeapSnapshotGridNode} |
| 395 */ | 405 */ |
| 396 function afterPopulate() | 406 function afterPopulate() |
| 397 { | 407 { |
| 398 var children = this.allChildren(); | 408 var children = this.allChildren(); |
| 399 for (var i = 0, l = children.length; i < l; ++i) { | 409 for (var i = 0, l = children.length; i < l; ++i) { |
| 400 var child = children[i]; | 410 var child = children[i]; |
| (...skipping 859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1260 }, | 1270 }, |
| 1261 | 1271 |
| 1262 _emptyData: function() | 1272 _emptyData: function() |
| 1263 { | 1273 { |
| 1264 return {}; | 1274 return {}; |
| 1265 }, | 1275 }, |
| 1266 | 1276 |
| 1267 __proto__: WebInspector.HeapSnapshotGenericObjectNode.prototype | 1277 __proto__: WebInspector.HeapSnapshotGenericObjectNode.prototype |
| 1268 } | 1278 } |
| 1269 | 1279 |
| OLD | NEW |