Diff
Modified: trunk/LayoutTests/ChangeLog (112221 => 112222)
--- trunk/LayoutTests/ChangeLog 2012-03-27 07:59:59 UTC (rev 112221)
+++ trunk/LayoutTests/ChangeLog 2012-03-27 08:18:26 UTC (rev 112222)
@@ -1,3 +1,15 @@
+2012-03-27 Yury Semikhatsky <yu...@chromium.org>
+
+ Web Inspector: remove remains of path finder in heap profiler front-end
+ https://bugs.webkit.org/show_bug.cgi?id=82304
+
+ Removed remainders of heap path finder as this code is not used anymore.
+
+ Reviewed by Pavel Feldman.
+
+ * inspector/profiler/heap-snapshot-expected.txt:
+ * inspector/profiler/heap-snapshot.html:
+
2012-03-27 Philippe Normand <pnorm...@igalia.com>
Unreviewed, GTK rebaseline.
Modified: trunk/LayoutTests/inspector/profiler/heap-snapshot-expected.txt (112221 => 112222)
--- trunk/LayoutTests/inspector/profiler/heap-snapshot-expected.txt 2012-03-27 07:59:59 UTC (rev 112221)
+++ trunk/LayoutTests/inspector/profiler/heap-snapshot-expected.txt 2012-03-27 08:18:26 UTC (rev 112222)
@@ -23,5 +23,3 @@
Running: heapSnapshotEdgesProviderTest
-Running: heapSnapshotPathFinderTest
-
Modified: trunk/LayoutTests/inspector/profiler/heap-snapshot.html (112221 => 112222)
--- trunk/LayoutTests/inspector/profiler/heap-snapshot.html 2012-03-27 07:59:59 UTC (rev 112221)
+++ trunk/LayoutTests/inspector/profiler/heap-snapshot.html 2012-03-27 08:18:26 UTC (rev 112222)
@@ -211,34 +211,6 @@
names.push(provider.item.name);
InspectorTest.assertEquals("b", names.join(","), "edges provider names");
next();
- },
-
- function heapSnapshotPathFinderTest(next)
- {
- var snapshot = new WebInspector.HeapSnapshot(InspectorTest.createHeapSnapshotMock());
- var expectedPaths = {
- 1: [],
- 14: [],
- 27: ["A@2[1]"],
- 40: ["a...@2.ac", "A@2[1].bc", "b...@3.bc"],
- 50: ["A@2[1].bd", "b...@3.bd"],
- 57: ["a...@2.ac.ce", "A@2[1].bc.ce", "b...@3.bc.ce"]
- };
- for (var nodes = snapshot._allNodes; nodes.hasNext(); nodes.next()) {
- var pathFinder = new WebInspector.HeapSnapshotPathFinder(snapshot, nodes.index);
- var paths = [];
- var path;
- while (true) {
- path = pathFinder.findNext();
- if (path === null)
- break;
- else if (path !== false)
- paths.push(path.path);
- }
- paths.sort();
- InspectorTest.assertEquals(expectedPaths[nodes.index].join(";"), paths.join(";"), "paths to \"" + nodes.item.name + "\"");
- }
- next();
}
]);
}
Modified: trunk/Source/WebCore/ChangeLog (112221 => 112222)
--- trunk/Source/WebCore/ChangeLog 2012-03-27 07:59:59 UTC (rev 112221)
+++ trunk/Source/WebCore/ChangeLog 2012-03-27 08:18:26 UTC (rev 112222)
@@ -1,3 +1,15 @@
+2012-03-27 Yury Semikhatsky <yu...@chromium.org>
+
+ Web Inspector: remove remains of path finder in heap profiler front-end
+ https://bugs.webkit.org/show_bug.cgi?id=82304
+
+ Removed remainders of heap path finder as this code is not used anymore.
+
+ Reviewed by Pavel Feldman.
+
+ * inspector/front-end/HeapSnapshot.js:
+ * inspector/front-end/HeapSnapshotProxy.js:
+
2012-03-27 Dan Bernstein <m...@apple.com>
Reverted r112214, since it was not the right fix for the build.
Modified: trunk/Source/WebCore/inspector/front-end/HeapSnapshot.js (112221 => 112222)
--- trunk/Source/WebCore/inspector/front-end/HeapSnapshot.js 2012-03-27 07:59:59 UTC (rev 112221)
+++ trunk/Source/WebCore/inspector/front-end/HeapSnapshot.js 2012-03-27 08:18:26 UTC (rev 112222)
@@ -1470,11 +1470,6 @@
return new WebInspector.HeapSnapshotNodesProvider(this, this._parseFilter(filter), this._dominatedNodesOfNode(node));
},
- createPathFinder: function(targetNodeIndex, skipHidden)
- {
- return new WebInspector.HeapSnapshotPathFinder(this, targetNodeIndex, skipHidden);
- },
-
updateStaticData: function()
{
return {nodeCount: this.nodeCount, rootNodeIndex: this._rootNodeIndex, totalSize: this.totalSize, uid: this.uid, nodeFlags: this._nodeFlags, maxNodeId: this.maxNodeId};
@@ -1753,190 +1748,6 @@
WebInspector.HeapSnapshotNodesProvider.prototype.__proto__ = WebInspector.HeapSnapshotFilteredOrderedIterator.prototype;
-WebInspector.HeapSnapshotPathFinder = function(snapshot, targetNodeIndex, skipHidden)
-{
- this._snapshot = snapshot;
- this._maxLength = 1;
- this._lengthLimit = 15;
- this._targetNodeIndex = targetNodeIndex;
- this._currentPath = null;
- this._skipHidden = skipHidden;
- this._rootChildren = this._fillRootChildren();
-}
-
-WebInspector.HeapSnapshotPathFinder.prototype = {
- findNext: function()
- {
- for (var i = 0; i < 100000; ++i) {
- if (!this._buildNextPath()) {
- if (++this._maxLength >= this._lengthLimit)
- return null;
- this._currentPath = null;
- if (!this._buildNextPath())
- return null;
- }
- if (this._isPathFound())
- return {path:this._pathToString(this._currentPath), route:this._pathToRoute(this._currentPath), len:this._currentPath.length};
- }
-
- return false;
- },
-
- updateRoots: function(filter)
- {
- if (filter)
- filter = eval("(function(){return " + filter + "})()");
- this._rootChildren = this._fillRootChildren(filter);
- this._reset();
- },
-
- _reset: function()
- {
- this._maxLength = 1;
- this._currentPath = null;
- },
-
- _fillRootChildren: function(filter)
- {
- var result = [];
- for (var iter = this._snapshot.rootNode.edges; iter.hasNext(); iter.next()) {
- if (!filter) {
- if (!iter.edge.isShortcut)
- result[iter.edge.nodeIndex] = true;
- } else if (filter(iter.edge.node)) {
- result[iter.edge.nodeIndex] = true;
- }
- }
- return result;
- },
-
- _appendToCurrentPath: function(iter)
- {
- this._currentPath._cache[this._lastEdge.nodeIndex] = true;
- this._currentPath.push(iter);
- },
-
- _removeLastFromCurrentPath: function()
- {
- this._currentPath.pop();
- delete this._currentPath._cache[this._lastEdge.nodeIndex];
- },
-
- _hasInPath: function(nodeIndex)
- {
- return this._targetNodeIndex === nodeIndex
- || !!this._currentPath._cache[nodeIndex];
- },
-
- _isPathFound: function()
- {
- return this._currentPath.length === this._maxLength
- && this._lastEdge.nodeIndex in this._rootChildren;
- },
-
- get _lastEdgeIter()
- {
- return this._currentPath[this._currentPath.length - 1];
- },
-
- get _lastEdge()
- {
- return this._lastEdgeIter.item;
- },
-
- _skipEdge: function(edge)
- {
- return edge.isInvisible
- || (this._skipHidden && (edge.isHidden || edge.node.isHidden))
- || edge.isWeak
- || this._hasInPath(edge.nodeIndex);
- },
-
- _nextEdgeIter: function()
- {
- var iter = this._lastEdgeIter;
- while (iter.hasNext() && this._skipEdge(iter.item))
- iter.next();
- return iter;
- },
-
- _buildNextPath: function()
- {
- if (this._currentPath !== null) {
- var iter = this._lastEdgeIter;
- while (true) {
- iter.next();
- iter = this._nextEdgeIter();
- if (iter.hasNext())
- return true;
- while (true) {
- if (this._currentPath.length > 1) {
- this._removeLastFromCurrentPath();
- iter = this._lastEdgeIter;
- iter.next();
- iter = this._nextEdgeIter();
- if (iter.hasNext()) {
- while (this._currentPath.length < this._maxLength) {
- iter = this._nextEdgeIter();
- if (iter.hasNext())
- this._appendToCurrentPath(iter.item.node.retainers);
- else
- return true;
- }
- return true;
- }
- } else
- return false;
- }
- }
- } else {
- var node = new WebInspector.HeapSnapshotNode(this._snapshot, this._targetNodeIndex);
- this._currentPath = [node.retainers];
- this._currentPath._cache = {};
- while (this._currentPath.length < this._maxLength) {
- var iter = this._nextEdgeIter();
- if (iter.hasNext())
- this._appendToCurrentPath(iter.item.node.retainers);
- else
- break;
- }
- return true;
- }
- },
-
- _nodeToString: function(node)
- {
- if (node.id === 1)
- return node.name;
- else
- return node.name + "@" + node.id;
- },
-
- _pathToString: function(path)
- {
- if (!path)
- return "";
- var sPath = [];
- for (var j = 0; j < path.length; ++j)
- sPath.push(path[j].item.toString());
- sPath.push(this._nodeToString(path[path.length - 1].item.node));
- sPath.reverse();
- return sPath.join("");
- },
-
- _pathToRoute: function(path)
- {
- if (!path)
- return [];
- var route = [];
- route.push(this._targetNodeIndex);
- for (var i = 0; i < path.length; ++i)
- route.push(path[i].item.nodeIndex);
- route.reverse();
- return route;
- }
-};
-
WebInspector.HeapSnapshotsDiff = function(snapshot, className)
{
this._snapshot = snapshot;
Modified: trunk/Source/WebCore/inspector/front-end/HeapSnapshotProxy.js (112221 => 112222)
--- trunk/Source/WebCore/inspector/front-end/HeapSnapshotProxy.js 2012-03-27 07:59:59 UTC (rev 112221)
+++ trunk/Source/WebCore/inspector/front-end/HeapSnapshotProxy.js 2012-03-27 08:18:26 UTC (rev 112222)
@@ -354,11 +354,6 @@
return this.callFactoryMethod(null, "createNodesProviderForDominator", "WebInspector.HeapSnapshotProviderProxy", nodeIndex, filter);
},
- createPathFinder: function(targetNodeIndex, skipHidden)
- {
- return this.callFactoryMethod(null, "createPathFinder", "WebInspector.HeapSnapshotPathFinderProxy", targetNodeIndex, skipHidden);
- },
-
dispose: function()
{
this.disposeWorker();