Changeset 112268 in webkit
- Timestamp:
- Mar 27, 2012 7:55:27 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r112266 r112268 1 2012-03-27 Yury Semikhatsky <yurys@chromium.org> 2 3 Web Inspector: simplify heap profiler front-end 4 https://bugs.webkit.org/show_bug.cgi?id=82338 5 6 Reviewed by Pavel Feldman. 7 8 * inspector/profiler/heap-snapshot.html: 9 1 10 2012-03-27 Pavel Podivilov <podivilov@chromium.org> 2 11 -
trunk/LayoutTests/inspector/profiler/heap-snapshot.html
r112262 r112268 217 217 } 218 218 219 var provider = new WebInspector.HeapSnapshotEdgesProvider(snapshot,snapshot.rootNodeIndex, edgeFilter);219 var provider = snapshot.createEdgesProvider(snapshot.rootNodeIndex, edgeFilter); 220 220 InspectorTest.assertEquals(1, provider.length, "edges provider length"); 221 221 provider.sort(WebInspector.HeapSnapshotFilteredOrderedIterator.prototype.createComparator(["!edgeName", false, "id", false]), 0, 0, 1); -
trunk/Source/WebCore/ChangeLog
r112267 r112268 1 2012-03-27 Yury Semikhatsky <yurys@chromium.org> 2 3 Web Inspector: simplify heap profiler front-end 4 https://bugs.webkit.org/show_bug.cgi?id=82338 5 6 Simplify constructors of WebInspector.HeapSnapshotArraySlice and 7 WebInspector.HeapSnapshotEdgesProvider. 8 9 Reviewed by Pavel Feldman. 10 11 * inspector/front-end/HeapSnapshot.js: 12 (WebInspector.HeapSnapshotArraySlice): 13 (WebInspector.HeapSnapshotArraySlice.prototype.item): 14 (WebInspector.HeapSnapshotArraySlice.prototype.slice): 15 (WebInspector.HeapSnapshotNode.prototype.get rawEdges): 16 (WebInspector.HeapSnapshot.prototype._retainersForNode): 17 (WebInspector.HeapSnapshot.prototype._dominatedNodesOfNode): 18 (WebInspector.HeapSnapshot.prototype.createEdgesProvider): 19 (WebInspector.HeapSnapshotEdgesProvider): 20 1 21 2012-03-27 Vsevolod Vlasov <vsevik@chromium.org> 2 22 -
trunk/Source/WebCore/inspector/front-end/HeapSnapshot.js
r112262 r112268 212 212 }; 213 213 214 WebInspector.HeapSnapshotArraySlice = function( snapshot, arrayName, start, end)214 WebInspector.HeapSnapshotArraySlice = function(array, start, end) 215 215 { 216 // Note: we don't reference snapshot contents directly to avoid 217 // holding references to big chunks of data. 218 this._snapshot = snapshot; 219 this._arrayName = arrayName; 216 this._array = array; 220 217 this._start = start; 221 218 this.length = end - start; … … 225 222 item: function(index) 226 223 { 227 return this._ snapshot[this._arrayName][this._start + index];224 return this._array[this._start + index]; 228 225 }, 229 226 … … 232 229 if (typeof end === "undefined") 233 230 end = this.length; 234 return this._ snapshot[this._arrayName].subarray(this._start + start, this._start + end);231 return this._array.subarray(this._start + start, this._start + end); 235 232 } 236 233 } … … 658 655 { 659 656 var firstEdgeIndex = this._firstEdgeIndex(); 660 return new WebInspector.HeapSnapshotArraySlice(this._snapshot , "_nodes", firstEdgeIndex, firstEdgeIndex + this.edgesCount * this._snapshot._edgeFieldsCount);657 return new WebInspector.HeapSnapshotArraySlice(this._snapshot._nodes, firstEdgeIndex, firstEdgeIndex + this.edgesCount * this._snapshot._edgeFieldsCount); 661 658 }, 662 659 … … 987 984 var retIndexFrom = this._getRetainerIndex(node.nodeIndex); 988 985 var retIndexTo = this._getRetainerIndex(node._nextNodeIndex); 989 return new WebInspector.HeapSnapshotArraySlice(this , "_retainers", retIndexFrom, retIndexTo);986 return new WebInspector.HeapSnapshotArraySlice(this._retainers, retIndexFrom, retIndexTo); 990 987 }, 991 988 … … 994 991 var dominatedIndexFrom = this._getDominatedIndex(node.nodeIndex); 995 992 var dominatedIndexTo = this._getDominatedIndex(node._nextNodeIndex); 996 return new WebInspector.HeapSnapshotArraySlice(this , "_dominatedNodes", dominatedIndexFrom, dominatedIndexTo);993 return new WebInspector.HeapSnapshotArraySlice(this._dominatedNodes, dominatedIndexFrom, dominatedIndexTo); 997 994 }, 998 995 … … 1448 1445 createEdgesProvider: function(nodeIndex, filter) 1449 1446 { 1450 return new WebInspector.HeapSnapshotEdgesProvider(this, nodeIndex, this._parseFilter(filter)); 1447 var node = new WebInspector.HeapSnapshotNode(this, nodeIndex); 1448 return new WebInspector.HeapSnapshotEdgesProvider(this, nodeIndex, this._parseFilter(filter), node.edges); 1451 1449 }, 1452 1450 … … 1605 1603 } 1606 1604 1607 WebInspector.HeapSnapshotEdgesProvider = function(snapshot, nodeIndex, filter, iter)1605 WebInspector.HeapSnapshotEdgesProvider = function(snapshot, nodeIndex, filter, edgesIter) 1608 1606 { 1609 1607 this.snapshot = snapshot; 1610 var node = new WebInspector.HeapSnapshotNode(snapshot, nodeIndex);1611 var edgesIter = iter || new WebInspector.HeapSnapshotEdgeIterator(new WebInspector.HeapSnapshotEdge(snapshot, node.rawEdges));1612 1608 WebInspector.HeapSnapshotFilteredOrderedIterator.call(this, edgesIter, filter); 1613 1609 }
Note: See TracChangeset
for help on using the changeset viewer.