Title: [114894] trunk/Source/WebCore
Revision
114894
Author
yu...@chromium.org
Date
2012-04-23 06:48:57 -0700 (Mon, 23 Apr 2012)

Log Message

Web Inspector: improve the way heap snapshot diff is calculated
https://bugs.webkit.org/show_bug.cgi?id=84590

Diff calculation now consists of the following steps:
1. Collect data about nodes in the base heap snapshot
2. Pass it to the second snapshot.
3. Calculate delta for each class.

Reviewed by Pavel Feldman.

* inspector/front-end/HeapSnapshot.js:
(WebInspector.HeapSnapshot):
(WebInspector.HeapSnapshot.prototype.dispose):
(WebInspector.HeapSnapshot.prototype.aggregatesForDiff):
(WebInspector.HeapSnapshot.prototype.calculateSnapshotDiff):
(WebInspector.HeapSnapshot.prototype._calculateDiffForClass):
(WebInspector.HeapSnapshot.prototype.createAddedNodesProvider):
(WebInspector.HeapSnapshot.prototype.createDeletedNodesProvider):
* inspector/front-end/HeapSnapshotDataGrids.js:
(WebInspector.HeapSnapshotDiffDataGrid.prototype._populateChildren.aggregatesForDiffReceived.didCalculateSnapshotDiff):
(WebInspector.HeapSnapshotDiffDataGrid.prototype._populateChildren):
* inspector/front-end/HeapSnapshotGridNodes.js:
(WebInspector.HeapSnapshotIteratorsTuple):
(WebInspector.HeapSnapshotDiffNode):
(WebInspector.HeapSnapshotDiffNode.prototype._createChildNode):
(WebInspector.HeapSnapshotDiffNode.prototype._createNodesProvider):
* inspector/front-end/HeapSnapshotProxy.js:
(WebInspector.HeapSnapshotProxy.prototype.aggregatesForDiff):
(WebInspector.HeapSnapshotProxy.prototype.calculateSnapshotDiff):
(WebInspector.HeapSnapshotProxy.prototype.createAddedNodesProvider):
(WebInspector.HeapSnapshotProxy.prototype.createDeletedNodesProvider):
* inspector/front-end/HeapSnapshotView.js:
(WebInspector.HeapSnapshotView.prototype._changeBase):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (114893 => 114894)


--- trunk/Source/WebCore/ChangeLog	2012-04-23 13:39:24 UTC (rev 114893)
+++ trunk/Source/WebCore/ChangeLog	2012-04-23 13:48:57 UTC (rev 114894)
@@ -1,3 +1,39 @@
+2012-04-23  Yury Semikhatsky  <yu...@chromium.org>
+
+        Web Inspector: improve the way heap snapshot diff is calculated
+        https://bugs.webkit.org/show_bug.cgi?id=84590
+
+        Diff calculation now consists of the following steps:
+        1. Collect data about nodes in the base heap snapshot
+        2. Pass it to the second snapshot.
+        3. Calculate delta for each class.
+
+        Reviewed by Pavel Feldman.
+
+        * inspector/front-end/HeapSnapshot.js:
+        (WebInspector.HeapSnapshot):
+        (WebInspector.HeapSnapshot.prototype.dispose):
+        (WebInspector.HeapSnapshot.prototype.aggregatesForDiff):
+        (WebInspector.HeapSnapshot.prototype.calculateSnapshotDiff):
+        (WebInspector.HeapSnapshot.prototype._calculateDiffForClass):
+        (WebInspector.HeapSnapshot.prototype.createAddedNodesProvider):
+        (WebInspector.HeapSnapshot.prototype.createDeletedNodesProvider):
+        * inspector/front-end/HeapSnapshotDataGrids.js:
+        (WebInspector.HeapSnapshotDiffDataGrid.prototype._populateChildren.aggregatesForDiffReceived.didCalculateSnapshotDiff):
+        (WebInspector.HeapSnapshotDiffDataGrid.prototype._populateChildren):
+        * inspector/front-end/HeapSnapshotGridNodes.js:
+        (WebInspector.HeapSnapshotIteratorsTuple):
+        (WebInspector.HeapSnapshotDiffNode):
+        (WebInspector.HeapSnapshotDiffNode.prototype._createChildNode):
+        (WebInspector.HeapSnapshotDiffNode.prototype._createNodesProvider):
+        * inspector/front-end/HeapSnapshotProxy.js:
+        (WebInspector.HeapSnapshotProxy.prototype.aggregatesForDiff):
+        (WebInspector.HeapSnapshotProxy.prototype.calculateSnapshotDiff):
+        (WebInspector.HeapSnapshotProxy.prototype.createAddedNodesProvider):
+        (WebInspector.HeapSnapshotProxy.prototype.createDeletedNodesProvider):
+        * inspector/front-end/HeapSnapshotView.js:
+        (WebInspector.HeapSnapshotView.prototype._changeBase):
+
 2012-04-23  Pavel Feldman  <pfeld...@chromium.org>
 
         Web Inspector: Rename and extract UISourceCodeImpl into _javascript_Source

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


--- trunk/Source/WebCore/inspector/front-end/HeapSnapshot.js	2012-04-23 13:39:24 UTC (rev 114893)
+++ trunk/Source/WebCore/inspector/front-end/HeapSnapshot.js	2012-04-23 13:48:57 UTC (rev 114894)
@@ -835,6 +835,9 @@
     this._metaNode = profile.snapshot.meta;
     this._strings = profile.strings;
 
+    this._snapshotDiffs = {};
+    this._aggregatesForDiff = null;
+
     this._init();
 }
 
@@ -1102,7 +1105,6 @@
             delete this._aggregates;
             delete this._aggregatesSortedFlags;
         }
-        delete this._baseNodeIds;
         delete this._dominatedNodes;
         delete this._firstDominatedNodeIndex;
         delete this._flags;
@@ -1114,17 +1116,6 @@
         return new WebInspector.HeapSnapshotNodeIterator(this.rootNode);
     },
 
-    nodeFieldValuesByIndex: function(fieldName, indexes)
-    {
-        var node = new WebInspector.HeapSnapshotNode(this);
-        var result = new Array(indexes.length);
-        for (var i = 0, l = indexes.length; i < l; ++i) {
-            node.nodeIndex = indexes[i];
-            result[i] = node[fieldName];
-        }
-        return result;
-    },
-
     get rootNode()
     {
         return new WebInspector.HeapSnapshotNode(this, this._rootNodeIndex);
@@ -1195,6 +1186,35 @@
         return aggregatesByClassName;
     },
 
+    aggregatesForDiff: function()
+    {
+        if (this._aggregatesForDiff)
+            return this._aggregatesForDiff;
+
+        var aggregatesByClassName = this.aggregates(true, "allObjects");
+        this._aggregatesForDiff  = {};
+
+        var node = new WebInspector.HeapSnapshotNode(this);
+        for (var className in aggregatesByClassName) {
+            var aggregate = aggregatesByClassName[className];
+            var indexes = aggregate.idxs;
+            var ids = new Array(indexes.length);
+            var selfSizes = new Array(indexes.length);
+            for (var i = 0; i < indexes.length; i++) {
+                node.nodeIndex = indexes[i];
+                ids[i] = node.id;
+                selfSizes[i] = node.selfSize;
+            }
+
+            this._aggregatesForDiff[className] = {
+                indexes: indexes,
+                ids: ids,
+                selfSizes: selfSizes
+            };
+        }
+        return this._aggregatesForDiff;
+    },
+
     _calculateObjectToWindowDistance: function()
     {
         this._distancesToWindow = new Array(this.nodeCount);
@@ -1509,23 +1529,78 @@
         this._markQueriableHeapObjects();
     },
 
-    baseSnapshotHasNode: function(baseSnapshotId, className, nodeId)
+    calculateSnapshotDiff: function(baseSnapshotId, baseSnapshotAggregates)
     {
-        return this._baseNodeIds[baseSnapshotId][className].binaryIndexOf(nodeId, this._numbersComparator) !== -1;
+        var snapshotDiff = this._snapshotDiffs[baseSnapshotId];
+        if (snapshotDiff)
+            return snapshotDiff;
+        snapshotDiff = {};
+
+        var aggregates = this.aggregates(true, "allObjects");
+        for (var className in baseSnapshotAggregates) {
+            var baseAggregate = baseSnapshotAggregates[className];
+            var diff = this._calculateDiffForClass(baseAggregate, aggregates[className]);
+            if (diff)
+                snapshotDiff[className] = diff;
+        }
+        var emptyBaseAggregate = { ids: [], indexes: [], selfSizes: [] };
+        for (var className in aggregates) {
+            if (className in baseSnapshotAggregates)
+                continue;
+            snapshotDiff[className] = this._calculateDiffForClass(emptyBaseAggregate, aggregates[className]);
+        }
+
+        this._snapshotDiffs[baseSnapshotId] = snapshotDiff;
+        return snapshotDiff;
     },
 
-    pushBaseIds: function(baseSnapshotId, className, nodeIds)
+    _calculateDiffForClass: function(baseAggregate, aggregate)
     {
-        if (!this._baseNodeIds)
-            this._baseNodeIds = [];
-        if (!this._baseNodeIds[baseSnapshotId])
-            this._baseNodeIds[baseSnapshotId] = {};
-        this._baseNodeIds[baseSnapshotId][className] = nodeIds;
-    },
+        var baseIds = baseAggregate.ids;
+        var baseIndexes = baseAggregate.indexes;
+        var baseSelfSizes = baseAggregate.selfSizes;
 
-    createDiff: function(className)
-    {
-        return new WebInspector.HeapSnapshotsDiff(this, className);
+        var indexes = aggregate ? aggregate.idxs : [];
+
+        var i = 0, l = baseIds.length;
+        var j = 0, m = indexes.length;
+        var diff = { addedCount: 0,
+                     removedCount: 0,
+                     addedSize: 0,
+                     removedSize: 0,
+                     deletedIndexes: [],
+                     addedIndexes: [] };
+
+        var nodeB = new WebInspector.HeapSnapshotNode(this, indexes[j]);
+        while (i < l && j < m) {
+            var nodeAId = baseIds[i];
+            if (nodeAId < nodeB.id) {
+                diff.deletedIndexes.push(baseIndexes[i]);
+                diff.removedCount++;
+                diff.removedSize += baseSelfSizes[i];
+                ++i;
+            } else { // nodeAId === nodeB.id
+                ++i;
+                nodeB.nodeIndex = indexes[++j];
+            }
+        }
+        while (i < l) {
+            diff.deletedIndexes.push(baseIndexes[i]);
+            diff.removedCount++;
+            diff.removedSize += baseSelfSizes[i];
+            ++i;
+        }
+        while (j < m) {
+            diff.addedIndexes.push(indexes[j]);
+            diff.addedCount++;
+            diff.addedSize += nodeB.selfSize;
+            nodeB.nodeIndex = indexes[++j];
+        }
+        diff.countDelta = diff.addedCount - diff.removedCount;
+        diff.sizeDelta = diff.addedSize - diff.removedSize;
+        if (!diff.addedCount && !diff.removedCount)
+            return null;
+        return diff;
     },
 
     _parseFilter: function(filter)
@@ -1548,6 +1623,18 @@
         return new WebInspector.HeapSnapshotEdgesProvider(this, nodeIndex, this._parseFilter(filter), node.retainers);
     },
 
+    createAddedNodesProvider: function(baseSnapshotId, className)
+    {
+        var snapshotDiff = this._snapshotDiffs[baseSnapshotId];
+        var diffForClass = snapshotDiff[className];
+        return new WebInspector.HeapSnapshotNodesProvider(this, null, diffForClass.addedIndexes);
+    },
+
+    createDeletedNodesProvider: function(nodeIndexes)
+    {
+        return new WebInspector.HeapSnapshotNodesProvider(this, null, nodeIndexes);
+    },
+
     createNodesProvider: function(filter)
     {
         return new WebInspector.HeapSnapshotNodesProvider(this, this._parseFilter(filter));
@@ -1852,63 +1939,3 @@
 };
 
 WebInspector.HeapSnapshotNodesProvider.prototype.__proto__ = WebInspector.HeapSnapshotFilteredOrderedIterator.prototype;
-
-/**
- * @constructor
- */
-WebInspector.HeapSnapshotsDiff = function(snapshot, className)
-{
-    this._snapshot = snapshot;
-    this._className = className;
-};
-
-WebInspector.HeapSnapshotsDiff.prototype = {
-    calculate: function()
-    {
-        var aggregates = this._snapshot.aggregates(true)[this._className];
-        var indexes = aggregates ? aggregates.idxs : [];
-        var i = 0, l = this._baseIds.length;
-        var j = 0, m = indexes.length;
-        var diff = { addedCount: 0, removedCount: 0, addedSize: 0, removedSize: 0 };
-
-        var nodeB = new WebInspector.HeapSnapshotNode(this._snapshot, indexes[j]);
-        while (i < l && j < m) {
-            var nodeAId = this._baseIds[i];
-            if (nodeAId < nodeB.id) {
-                diff.removedCount++;
-                diff.removedSize += this._baseSelfSizes[i];
-                ++i;
-            } else if (nodeAId > nodeB.id) {
-                diff.addedCount++;
-                diff.addedSize += nodeB.selfSize;
-                nodeB.nodeIndex = indexes[++j];
-            } else {
-                ++i;
-                nodeB.nodeIndex = indexes[++j];
-            }
-        }
-        while (i < l) {
-            diff.removedCount++;
-            diff.removedSize += this._baseSelfSizes[i];
-            ++i;
-        }
-        while (j < m) {
-            diff.addedCount++;
-            diff.addedSize += nodeB.selfSize;
-            nodeB.nodeIndex = indexes[++j];
-        }
-        diff.countDelta = diff.addedCount - diff.removedCount;
-        diff.sizeDelta = diff.addedSize - diff.removedSize;
-        return diff;
-    },
-
-    pushBaseIds: function(baseIds)
-    {
-        this._baseIds = baseIds;
-    },
-
-    pushBaseSelfSizes: function(baseSelfSizes)
-    {
-        this._baseSelfSizes = baseSelfSizes;
-    }
-};

Modified: trunk/Source/WebCore/inspector/front-end/HeapSnapshotDataGrids.js (114893 => 114894)


--- trunk/Source/WebCore/inspector/front-end/HeapSnapshotDataGrids.js	2012-04-23 13:39:24 UTC (rev 114893)
+++ trunk/Source/WebCore/inspector/front-end/HeapSnapshotDataGrids.js	2012-04-23 13:48:57 UTC (rev 114894)
@@ -515,11 +515,9 @@
         this.snapshot = snapshot;
     },
 
-    _baseProfileIndexChanged: function(loader, profileIndex)
-    {
-        loader(profileIndex, this.setBaseDataSource.bind(this));
-    },
-
+    /**
+     * @param {WebInspector.HeapSnapshotProxy} baseSnapshot
+     */
     setBaseDataSource: function(baseSnapshot)
     {
         this.baseSnapshot = baseSnapshot;
@@ -535,34 +533,22 @@
 
     _populateChildren: function()
     {
-        function baseAggregatesReceived(baseClasses)
+        function aggregatesForDiffReceived(aggregatesForDiff)
         {
-            function aggregatesReceived(classes)
+            this.snapshot.calculateSnapshotDiff(this.baseSnapshot.uid, aggregatesForDiff, didCalculateSnapshotDiff.bind(this));
+            function didCalculateSnapshotDiff(diffByClassName)
             {
-                var nodeCount = 0;
-                var nodes = [];
-                for (var clss in baseClasses)
-                    nodes.push(new WebInspector.HeapSnapshotDiffNode(this, clss, baseClasses[clss], classes[clss]));
-                for (clss in classes) {
-                    if (!(clss in baseClasses))
-                        nodes.push(new WebInspector.HeapSnapshotDiffNode(this, clss, null, classes[clss]));
+                for (var className in diffByClassName) {
+                    var diff = diffByClassName[className];
+                    this.appendTopLevelNode(new WebInspector.HeapSnapshotDiffNode(this, className, diff));
                 }
-                nodeCount = nodes.length;
-                function addNodeIfNonZeroDiff(boundNode, zeroDiff)
-                {
-                    if (!zeroDiff)
-                        this.appendTopLevelNode(boundNode);
-                    if (!--nodeCount)
-                        this.sortingChanged();
-                }
-                for (var i = 0, l = nodes.length; i < l; ++i) {
-                    var node = nodes[i];
-                    node.calculateDiff(this, addNodeIfNonZeroDiff.bind(this, node));
-                }
+                this.sortingChanged();
             }
-            this.snapshot.aggregates(true, "allObjects", null, aggregatesReceived.bind(this));
         }
-        this.baseSnapshot.aggregates(true, "allObjects", null, baseAggregatesReceived.bind(this));
+        // Two snapshots live in different workers isolated from each other. That is why
+        // we first need to collect information about the nodes in the first snapshot and
+        // then pass it to the second snapshot to calclulate the diff.
+        this.baseSnapshot.aggregatesForDiff(aggregatesForDiffReceived.bind(this));
     }
 };
 

Modified: trunk/Source/WebCore/inspector/front-end/HeapSnapshotGridNodes.js (114893 => 114894)


--- trunk/Source/WebCore/inspector/front-end/HeapSnapshotGridNodes.js	2012-04-23 13:39:24 UTC (rev 114893)
+++ trunk/Source/WebCore/inspector/front-end/HeapSnapshotGridNodes.js	2012-04-23 13:48:57 UTC (rev 114894)
@@ -690,11 +690,15 @@
  * @constructor
  * @param {WebInspector.HeapSnapshotProviderProxy} it1
  * @param {WebInspector.HeapSnapshotProviderProxy} it2
+ * @param {WebInspector.HeapSnapshotProxy} baseSnapshot
+ * @param {WebInspector.HeapSnapshotProxy} snapshot
  */
-WebInspector.HeapSnapshotIteratorsTuple = function(it1, it2)
+WebInspector.HeapSnapshotIteratorsTuple = function(it1, it2, baseSnapshot, snapshot)
 {
     this._it1 = it1;
     this._it2 = it2;
+    this.baseSnapshot = baseSnapshot;
+    this.snapshot = snapshot;
 }
 
 WebInspector.HeapSnapshotIteratorsTuple.prototype = {
@@ -718,82 +722,43 @@
  * @constructor
  * @extends {WebInspector.HeapSnapshotGridNode}
  */
-WebInspector.HeapSnapshotDiffNode = function(tree, className, baseAggregate, aggregate)
+WebInspector.HeapSnapshotDiffNode = function(tree, className, diffForClass)
 {
     WebInspector.HeapSnapshotGridNode.call(this, tree, true);
     this._name = className;
-    this._baseIndexes = baseAggregate ? baseAggregate.idxs : [];
-    this._indexes = aggregate ? aggregate.idxs : [];
 
+    this._addedCount = diffForClass.addedCount;
+    this._removedCount = diffForClass.removedCount;
+    this._countDelta = diffForClass.countDelta;
+    this._addedSize = diffForClass.addedSize;
+    this._removedSize = diffForClass.removedSize;
+    this._sizeDelta = diffForClass.sizeDelta;
+
+    this._deletedIndexes = diffForClass.deletedIndexes;
+
     /**
      * @type {WebInspector.HeapSnapshotIteratorsTuple}
      */
-    this._provider = this._createNodesProvider(tree.baseSnapshot, tree.snapshot, aggregate ? aggregate.type : baseAggregate.type, className);
+    this._provider = this._createNodesProvider(tree.baseSnapshot, tree.snapshot);
 }
 
 WebInspector.HeapSnapshotDiffNode.prototype = {
-    calculateDiff: function(dataGrid, callback)
-    {
-        var diff = dataGrid.snapshot.createDiff(this._name);
-
-        function diffCalculated(diffResult)
-        {
-            diff.dispose();
-            this._addedCount = diffResult.addedCount;
-            this._removedCount = diffResult.removedCount;
-            this._countDelta = diffResult.countDelta;
-            this._addedSize = diffResult.addedSize;
-            this._removedSize = diffResult.removedSize;
-            this._sizeDelta = diffResult.sizeDelta;
-            this._baseIndexes = null;
-            this._indexes = null;
-            callback(this._addedSize === 0 && this._removedSize === 0);
-        }
-        function baseSelfSizesReceived(baseSelfSizes)
-        {
-            diff.pushBaseSelfSizes(baseSelfSizes);
-            diff.calculate(diffCalculated.bind(this));
-        }
-        function baseIdsReceived(baseIds)
-        {
-            diff.pushBaseIds(baseIds);
-            dataGrid.snapshot.pushBaseIds(dataGrid.baseSnapshot.uid, this._name, baseIds);
-            dataGrid.baseSnapshot.nodeFieldValuesByIndex("selfSize", this._baseIndexes, baseSelfSizesReceived.bind(this));
-        }
-        function idsReceived(ids)
-        {
-            dataGrid.baseSnapshot.pushBaseIds(dataGrid.snapshot.uid, this._name, ids);
-        }
-        dataGrid.baseSnapshot.nodeFieldValuesByIndex("id", this._baseIndexes, baseIdsReceived.bind(this));
-        dataGrid.snapshot.nodeFieldValuesByIndex("id", this._indexes, idsReceived.bind(this));
-    },
-
     _createChildNode: function(item, provider)
     {
         if (provider === this._provider._it1)
-            return new WebInspector.HeapSnapshotInstanceNode(this._dataGrid, null, provider.snapshot, item);
+            return new WebInspector.HeapSnapshotInstanceNode(this._dataGrid, null, this._provider.snapshot, item);
         else
-            return new WebInspector.HeapSnapshotInstanceNode(this._dataGrid, provider.snapshot, null, item);
+            return new WebInspector.HeapSnapshotInstanceNode(this._dataGrid, this._provider.baseSnapshot, null, item);
     },
 
-    _createNodesProvider: function(baseSnapshot, snapshot, nodeType, nodeClassName)
+    _createNodesProvider: function(baseSnapshot, snapshot)
     {
         var className = this._name;
         return new WebInspector.HeapSnapshotIteratorsTuple(
-            createProvider(snapshot, baseSnapshot), createProvider(baseSnapshot, snapshot));
-
-        function createProvider(snapshot, otherSnapshot)
-        {
-            var otherSnapshotId = otherSnapshot.uid;
-            var provider = snapshot.createNodesProvider(
-                "function (node) {" +
-                "     return node.type === \"" + nodeType + "\" " +
-                (nodeClassName !== null ? "&& node.className === \"" + nodeClassName + "\"" : "") +
-                "         && !this.baseSnapshotHasNode(" + otherSnapshotId + ", \"" + className + "\", node.id);" +
-                "}");
-            provider.snapshot = snapshot;
-            return provider;
-        }
+            snapshot.createAddedNodesProvider(baseSnapshot.uid, className),
+            baseSnapshot.createDeletedNodesProvider(this._deletedIndexes),
+            baseSnapshot,
+            snapshot);
     },
 
     _childHashForEntity: function(node)

Modified: trunk/Source/WebCore/inspector/front-end/HeapSnapshotProxy.js (114893 => 114894)


--- trunk/Source/WebCore/inspector/front-end/HeapSnapshotProxy.js	2012-04-23 13:39:24 UTC (rev 114893)
+++ trunk/Source/WebCore/inspector/front-end/HeapSnapshotProxy.js	2012-04-23 13:48:57 UTC (rev 114894)
@@ -372,11 +372,16 @@
         this.callMethod(callback, "aggregates", sortedIndexes, key, filter);
     },
 
-    createDiff: function(className)
+    aggregatesForDiff: function(callback)
     {
-        return this.callFactoryMethod(null, "createDiff",  "WebInspector.HeapSnapshotsDiffProxy", className);
+        this.callMethod(callback, "aggregatesForDiff");
     },
 
+    calculateSnapshotDiff: function(baseSnapshotId, baseSnapshotAggregates, callback)
+    {
+        this.callMethod(callback, "calculateSnapshotDiff", baseSnapshotId, baseSnapshotAggregates);
+    },
+
     createEdgesProvider: function(nodeIndex, filter)
     {
         return this.callFactoryMethod(null, "createEdgesProvider", "WebInspector.HeapSnapshotProviderProxy", nodeIndex, filter);
@@ -387,6 +392,16 @@
         return this.callFactoryMethod(null, "createRetainingEdgesProvider", "WebInspector.HeapSnapshotProviderProxy", nodeIndex, filter);
     },
 
+    createAddedNodesProvider: function(baseSnapshotId, className)
+    {
+        return this.callFactoryMethod(null, "createAddedNodesProvider", "WebInspector.HeapSnapshotProviderProxy", baseSnapshotId, className);
+    },
+
+    createDeletedNodesProvider: function(nodeIndexes)
+    {
+        return this.callFactoryMethod(null, "createDeletedNodesProvider", "WebInspector.HeapSnapshotProviderProxy", nodeIndexes);
+    },
+
     createNodesProvider: function(filter)
     {
         return this.callFactoryMethod(null, "createNodesProvider", "WebInspector.HeapSnapshotProviderProxy", filter);
@@ -422,21 +437,11 @@
         return this._staticData.nodeCount;
     },
 
-    nodeFieldValuesByIndex: function(fieldName, indexes, callback)
-    {
-        this.callMethod(callback, "nodeFieldValuesByIndex", fieldName, indexes);
-    },
-
     get nodeFlags()
     {
         return this._staticData.nodeFlags;
     },
 
-    pushBaseIds: function(snapshotId, className, nodeIds)
-    {
-        this.callMethod(null, "pushBaseIds", snapshotId, className, nodeIds);
-    },
-
     get rootNodeIndex()
     {
         return this._staticData.rootNodeIndex;
@@ -498,31 +503,3 @@
 };
 
 WebInspector.HeapSnapshotProviderProxy.prototype.__proto__ = WebInspector.HeapSnapshotProxyObject.prototype;
-
-/**
- * @constructor
- * @extends {WebInspector.HeapSnapshotProxyObject}
- */
-WebInspector.HeapSnapshotsDiffProxy = function(worker, objectId)
-{
-    WebInspector.HeapSnapshotProxyObject.call(this, worker, objectId);
-}
-
-WebInspector.HeapSnapshotsDiffProxy.prototype = {
-    calculate: function(callback)
-    {
-        this.callMethod(callback, "calculate");
-    },
-
-    pushBaseIds: function(baseIds)
-    {
-        this.callMethod(null, "pushBaseIds", baseIds);
-    },
-
-    pushBaseSelfSizes: function(baseSelfSizes)
-    {
-        this.callMethod(null, "pushBaseSelfSizes", baseSelfSizes);
-    }
-};
-
-WebInspector.HeapSnapshotsDiffProxy.prototype.__proto__ = WebInspector.HeapSnapshotProxyObject.prototype;

Modified: trunk/Source/WebCore/inspector/front-end/HeapSnapshotView.js (114893 => 114894)


--- trunk/Source/WebCore/inspector/front-end/HeapSnapshotView.js	2012-04-23 13:39:24 UTC (rev 114893)
+++ trunk/Source/WebCore/inspector/front-end/HeapSnapshotView.js	2012-04-23 13:48:57 UTC (rev 114894)
@@ -370,7 +370,7 @@
 
         this._baseProfileUid = this._profiles()[this.baseSelectElement.selectedIndex].uid;
         var dataGrid = /** @type {WebInspector.HeapSnapshotDiffDataGrid} */ this.dataGrid;
-        dataGrid._baseProfileIndexChanged(this._loadProfileByIndex.bind(this), this.baseSelectElement.selectedIndex);
+        this._loadProfile(this._baseProfileUid, dataGrid.setBaseDataSource.bind(dataGrid));
 
         if (!this.currentQuery || !this._searchFinishedCallback || !this._searchResults)
             return;
@@ -425,12 +425,6 @@
         WebInspector.panels.profiles.loadHeapSnapshot(profileUid, callback);
     },
 
-    _loadProfileByIndex: function(profileIndex, callback)
-    {
-        var profileUid = this._profiles()[profileIndex].uid;
-        WebInspector.panels.profiles.loadHeapSnapshot(profileUid, callback);
-    },
-
     isDetailedSnapshot: function(snapshot)
     {
         var s = new WebInspector.HeapSnapshot(snapshot);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to