Web Inspector: get rid of artificial heap snapshot nodes from the retaining tree.
authorloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Feb 2012 07:52:59 +0000 (07:52 +0000)
committerloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Feb 2012 07:52:59 +0000 (07:52 +0000)
https://bugs.webkit.org/show_bug.cgi?id=77850

Reviewed by Yury Semikhatsky.

* inspector/front-end/DetailedHeapshotGridNodes.js:
(WebInspector.HeapSnapshotObjectNode):
(WebInspector.HeapSnapshotObjectNode.prototype.updateHasChildren):
(WebInspector.HeapSnapshotObjectNode.prototype._prefixObjectCell):
* inspector/front-end/HeapSnapshot.js:
(WebInspector.HeapSnapshotNode.prototype.get isArtificial):
(WebInspector.HeapSnapshot.prototype._init):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@106778 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/inspector/front-end/DetailedHeapshotGridNodes.js
Source/WebCore/inspector/front-end/HeapSnapshot.js

index bc17a51c105aa3dcf21fc8deaf1ecbaf8b02fca6..90aa4df1ea3dc5b67ab06c5666dc80513531d38f 100644 (file)
@@ -1,3 +1,18 @@
+2012-02-05  Ilya Tikhonovsky  <loislo@chromium.org>
+
+        Web Inspector: get rid of artificial heap snapshot nodes from the retaining tree.
+        https://bugs.webkit.org/show_bug.cgi?id=77850
+
+        Reviewed by Yury Semikhatsky.
+
+        * inspector/front-end/DetailedHeapshotGridNodes.js:
+        (WebInspector.HeapSnapshotObjectNode):
+        (WebInspector.HeapSnapshotObjectNode.prototype.updateHasChildren):
+        (WebInspector.HeapSnapshotObjectNode.prototype._prefixObjectCell):
+        * inspector/front-end/HeapSnapshot.js:
+        (WebInspector.HeapSnapshotNode.prototype.get isArtificial):
+        (WebInspector.HeapSnapshot.prototype._init):
+
 2012-02-05  Peter Rybin  <peter.rybin@gmail.com>
 
         Web Inspector: CodeGeneratorInspector.py: switch domain agents to formal interfaces in BackendDispatcher
index 7cc8a9696cb44daac5f53524f565e2cb16d29c20..a771ec42f2cac3d4f3dee3c4443a2168ed06d487 100644 (file)
@@ -363,7 +363,7 @@ WebInspector.HeapSnapshotObjectNode = function(tree, isFromBaseSnapshot, edge, p
     this._referenceName = edge.name;
     this._referenceType = edge.type;
     this._propertyAccessor = edge.propertyAccessor;
-    this._retainerNode = tree.showRetainingEdges;
+    this.showRetainingEdges = tree.showRetainingEdges;
     this._isFromBaseSnapshot = isFromBaseSnapshot;
     this._provider = this._createProvider(!isFromBaseSnapshot ? tree.snapshot : tree.baseSnapshot, edge.nodeIndex, tree);
     this.updateHasChildren(parentGridNode);
@@ -372,7 +372,7 @@ WebInspector.HeapSnapshotObjectNode = function(tree, isFromBaseSnapshot, edge, p
 WebInspector.HeapSnapshotObjectNode.prototype = {
     updateHasChildren: function(parentGridNode)
     {
-        if (this._retainerNode) {
+        if (this.showRetainingEdges) {
             this._parentGridNode = parentGridNode;
             var ancestor = parentGridNode;
             while (ancestor) {
@@ -394,10 +394,11 @@ WebInspector.HeapSnapshotObjectNode.prototype = {
     _createProvider: function(snapshot, nodeIndex, tree)
     {
         var showHiddenData = WebInspector.settings.showHeapSnapshotObjectsHiddenProperties.get();
-        var filter = "function(edge) {" +
-            "    return !edge.isInvisible" +
-            "        && (" + showHiddenData + " || (!edge.isHidden && !edge.node.isHidden));" +
-            "}";
+        var filter = "function(edge) {\n" +
+            "    return !edge.isInvisible\n" +
+            "        && (" + !this.showRetainingEdges + " || (edge.node.id !== 1 && !edge.node.isArtificial))\n" +
+            "        && (" + showHiddenData + " || (!edge.isHidden && !edge.node.isHidden));\n" +
+            "}\n";
         if (tree.showRetainingEdges)
             return snapshot.createRetainingEdgesProvider(nodeIndex, filter);
         else
@@ -453,7 +454,7 @@ WebInspector.HeapSnapshotObjectNode.prototype = {
 
     _prefixObjectCell: function(div, data)
     {
-        if (this._retainerNode) {
+        if (this.showRetainingEdges) {
             if (this._cycledWithAncestorGridNode)
                 div.className += " cycled-ancessor-node";
             var referenceNameSpan = document.createElement("span");
index 5e243aa14e29852982839fea25fbe1267dec5b5e..4a57ad7e61c794995a7cef0ba8b69847d8e8ce05 100644 (file)
@@ -566,6 +566,11 @@ WebInspector.HeapSnapshotNode.prototype = {
         return this._type() === this._snapshot._nodeHiddenType;
     },
 
+    get isArtificial()
+    {
+        return this._type() === this._snapshot._nodeArtificialType;
+    },
+
     get isDOMWindow()
     {
         return this.name.substr(0, 9) === "DOMWindow";
@@ -706,6 +711,7 @@ WebInspector.HeapSnapshot.prototype = {
         this._firstEdgeOffset = meta.fields.indexOf("children");
         this._nodeTypes = meta.types[this._nodeTypeOffset];
         this._nodeHiddenType = this._nodeTypes.indexOf("hidden");
+        this._nodeArtificialType = this._nodeTypes.indexOf("artificial");
         var edgesMeta = meta.types[this._firstEdgeOffset];
         this._edgeFieldsCount = edgesMeta.fields.length;
         this._edgeTypeOffset = edgesMeta.fields.indexOf("type");