Web Inspector: Hide ["PrivateSymbol.concatSlowPath"] and other PrivateSymbols from...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 12 Sep 2016 21:46:49 +0000 (21:46 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 12 Sep 2016 21:46:49 +0000 (21:46 +0000)
https://bugs.webkit.org/show_bug.cgi?id=156763

Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2016-09-12
Reviewed by Joseph Pecoraro.

* UserInterface/Proxies/HeapSnapshotEdgeProxy.js:
(WebInspector.HeapSnapshotEdgeProxy.prototype.isPrivateSymbol):
Checks that the edge data does not begin with "PrivateSymbol".

* UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:
(WebInspector.HeapSnapshotInstanceDataGridNode.prototype._populate):
Only add child nodes if they are not PrivateSymbol nodes.

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

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Proxies/HeapSnapshotEdgeProxy.js
Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstanceDataGridNode.js

index f486a2e..f05ec3c 100644 (file)
@@ -1,3 +1,18 @@
+2016-09-12  Devin Rousso  <dcrousso+webkit@gmail.com>
+
+        Web Inspector: Hide ["PrivateSymbol.concatSlowPath"] and other PrivateSymbols from memory edges
+        https://bugs.webkit.org/show_bug.cgi?id=156763
+
+        Reviewed by Joseph Pecoraro.
+
+        * UserInterface/Proxies/HeapSnapshotEdgeProxy.js:
+        (WebInspector.HeapSnapshotEdgeProxy.prototype.isPrivateSymbol):
+        Checks that the edge data does not begin with "PrivateSymbol".
+
+        * UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:
+        (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._populate):
+        Only add child nodes if they are not PrivateSymbol nodes.
+
 2016-09-12  Matt Baker  <mattbaker@apple.com>
 
         Web Inspector: Object.shallowEqual() should return false if object prototype chains differ
index 6a69d5d..e4d44b1 100644 (file)
@@ -42,6 +42,14 @@ WebInspector.HeapSnapshotEdgeProxy = class HeapSnapshotEdgeProxy
         this.to = null;
     }
 
+    isPrivateSymbol()
+    {
+        if (WebInspector.isDebugUIEnabled())
+            return false;
+
+        return typeof this.data === "string" && this.data.startsWith("PrivateSymbol");
+    }
+
     // Static
 
     static deserialize(objectId, serializedEdge)
index acb2043..8404484 100644 (file)
@@ -221,8 +221,12 @@ WebInspector.HeapSnapshotInstanceDataGridNode = class HeapSnapshotInstanceDataGr
 
             // FIXME: This should gracefully handle a node that references many objects.
 
-            for (let instance of instances)
+            for (let instance of instances) {
+                if (instance.__edge && instance.__edge.isPrivateSymbol())
+                    continue;
+
                 this.appendChild(new WebInspector.HeapSnapshotInstanceDataGridNode(instance, this._tree, instance.__edge, this._base || this));
+            }
         });
     }