Title: [111548] trunk/Source/WebCore
Revision
111548
Author
[email protected]
Date
2012-03-21 08:48:46 -0700 (Wed, 21 Mar 2012)

Log Message

Web Inspector: HeapSnapshot: move all builders and calculation calls to HeapSnapshot._init function.
https://bugs.webkit.org/show_bug.cgi?id=81784

Reviewed by Yury Semikhatsky.

* inspector/front-end/HeapSnapshot.js:
(WebInspector.HeapSnapshot.prototype._init):
(WebInspector.HeapSnapshot.prototype.dispose):
(WebInspector.HeapSnapshot.prototype._retainersForNode):
(WebInspector.HeapSnapshot.prototype._dominatedNodesOfNode):
(WebInspector.HeapSnapshot.prototype._flagsOfNode):
(WebInspector.HeapSnapshot.prototype.aggregates):
(WebInspector.HeapSnapshot.prototype._buildRetainers):
(WebInspector.HeapSnapshot.prototype.get nodeIndexes):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (111547 => 111548)


--- trunk/Source/WebCore/ChangeLog	2012-03-21 15:45:35 UTC (rev 111547)
+++ trunk/Source/WebCore/ChangeLog	2012-03-21 15:48:46 UTC (rev 111548)
@@ -1,3 +1,20 @@
+2012-03-21  Ilya Tikhonovsky  <[email protected]>
+
+        Web Inspector: HeapSnapshot: move all builders and calculation calls to HeapSnapshot._init function.
+        https://bugs.webkit.org/show_bug.cgi?id=81784
+
+        Reviewed by Yury Semikhatsky.
+
+        * inspector/front-end/HeapSnapshot.js:
+        (WebInspector.HeapSnapshot.prototype._init):
+        (WebInspector.HeapSnapshot.prototype.dispose):
+        (WebInspector.HeapSnapshot.prototype._retainersForNode):
+        (WebInspector.HeapSnapshot.prototype._dominatedNodesOfNode):
+        (WebInspector.HeapSnapshot.prototype._flagsOfNode):
+        (WebInspector.HeapSnapshot.prototype.aggregates):
+        (WebInspector.HeapSnapshot.prototype._buildRetainers):
+        (WebInspector.HeapSnapshot.prototype.get nodeIndexes):
+
 2012-03-21  Jessie Berlin  <[email protected]>
 
         WTF headers should be in $(ConfigurationBuildDir)\include\private\wtf, not

Modified: trunk/Source/WebCore/inspector/front-end/HeapSnapshot.js (111547 => 111548)


--- trunk/Source/WebCore/inspector/front-end/HeapSnapshot.js	2012-03-21 15:45:35 UTC (rev 111547)
+++ trunk/Source/WebCore/inspector/front-end/HeapSnapshot.js	2012-03-21 15:48:46 UTC (rev 111548)
@@ -792,8 +792,12 @@
             detachedDOMTreeNode: 2,
         };
 
-        this._distancesToWindow = [];
         this._markInvisibleEdges();
+        this._buildNodeIndex();
+        this._buildRetainers();
+        this._buildDominatedNodes();
+        this._calculateFlags();
+        this._calculateObjectToWindowDistance();
     },
 
     dispose: function()
@@ -811,6 +815,7 @@
         delete this._dominatedNodes;
         delete this._dominatedIndex;
         delete this._flags;
+        delete this._distancesToWindow;
     },
 
     get _allNodes()
@@ -866,9 +871,6 @@
 
     _retainersForNode: function(node)
     {
-        if (!this._retainers)
-            this._buildRetainers();
-
         var retIndexFrom = this._getRetainerIndex(node.nodeIndex);
         var retIndexTo = this._getRetainerIndex(node._nextNodeIndex);
         return new WebInspector.HeapSnapshotArraySlice(this, "_retainers", retIndexFrom, retIndexTo);
@@ -876,9 +878,6 @@
 
     _dominatedNodesOfNode: function(node)
     {
-        if (!this._dominatedNodes)
-            this._buildDominatedNodes();
-
         var dominatedIndexFrom = this._getDominatedIndex(node.nodeIndex);
         var dominatedIndexTo = this._getDominatedIndex(node._nextNodeIndex);
         return new WebInspector.HeapSnapshotArraySlice(this, "_dominatedNodes", dominatedIndexFrom, dominatedIndexTo);
@@ -886,16 +885,11 @@
 
     _flagsOfNode: function(node)
     {
-        if (!this._flags)
-            this._calculateFlags();
         return this._flags[node.nodeIndex];
     },
 
     aggregates: function(sortedIndexes, key, filterString)
     {
-        if (!this._retainers)
-            this._buildRetainers();
-
         if (!this._aggregates) {
             this._aggregates = {};
             this._aggregatesSortedFlags = {};
@@ -927,9 +921,6 @@
 
     _buildReverseIndex: function(indexArrayName, backRefsArrayName, indexCallback, dataCallback)
     {
-        if (!this._nodeIndex)
-            this._buildNodeIndex();
-
         // Builds up two arrays:
         //  - "backRefsArray" is a continuous array, where each node owns an
         //    interval (can be empty) with corresponding back references.
@@ -981,7 +972,6 @@
                      dataCallback(indexCallback(retIndex), node.nodeIndex + this._firstEdgeOffset + edge.edgeIndex);
                  }
              }).bind(this));
-        this._calculateObjectToWindowDistance();
     },
 
     _calculateObjectToWindowDistance: function()
@@ -1112,8 +1102,6 @@
 
     get nodeIndexes()
     {
-        if (!this._nodeIndex)
-            this._buildNodeIndex();
         return this._nodeIndex;
     },
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to