Title: [199971] trunk/Source/WebInspectorUI
Revision
199971
Author
mattba...@apple.com
Date
2016-04-24 17:59:48 -0700 (Sun, 24 Apr 2016)

Log Message

Web Inspector: Events in _javascript_ & Events timeline have no profile children
https://bugs.webkit.org/show_bug.cgi?id=156627
<rdar://problem/25749740>

Reviewed by Timothy Hatcher.

ProfileNodeDataGridNode should handle `populate` events when expanded.
This was previously done by ProfileNodeTreeElement, which is no longer
used in the Timelines tab.

* UserInterface/Views/ProfileDataGridNode.js:
(WebInspector.ProfileDataGridNode.prototype._updateChildrenForModifiers):
(WebInspector.ProfileDataGridNode.prototype._populate):
(WebInspector.ProfileDataGridNode):
DataGridNode sets `shouldRefreshChildren` to false after populating
child nodes. No need to track with a separate flag.

* UserInterface/Views/ProfileNodeDataGridNode.js:
(WebInspector.ProfileNodeDataGridNode):
(WebInspector.ProfileNodeDataGridNode.prototype._populate):

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (199970 => 199971)


--- trunk/Source/WebInspectorUI/ChangeLog	2016-04-25 00:27:30 UTC (rev 199970)
+++ trunk/Source/WebInspectorUI/ChangeLog	2016-04-25 00:59:48 UTC (rev 199971)
@@ -1,3 +1,26 @@
+2016-04-24  Matt Baker  <mattba...@apple.com>
+
+        Web Inspector: Events in _javascript_ & Events timeline have no profile children
+        https://bugs.webkit.org/show_bug.cgi?id=156627
+        <rdar://problem/25749740>
+
+        Reviewed by Timothy Hatcher.
+
+        ProfileNodeDataGridNode should handle `populate` events when expanded.
+        This was previously done by ProfileNodeTreeElement, which is no longer
+        used in the Timelines tab.
+
+        * UserInterface/Views/ProfileDataGridNode.js:
+        (WebInspector.ProfileDataGridNode.prototype._updateChildrenForModifiers):
+        (WebInspector.ProfileDataGridNode.prototype._populate):
+        (WebInspector.ProfileDataGridNode):
+        DataGridNode sets `shouldRefreshChildren` to false after populating
+        child nodes. No need to track with a separate flag.
+
+        * UserInterface/Views/ProfileNodeDataGridNode.js:
+        (WebInspector.ProfileNodeDataGridNode):
+        (WebInspector.ProfileNodeDataGridNode.prototype._populate):
+
 2016-04-22  Matt Baker  <mattba...@apple.com>
 
         Web Inspector: HeapAllocationsTimeline grid should use built-in grid column icons

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ProfileDataGridNode.js (199970 => 199971)


--- trunk/Source/WebInspectorUI/UserInterface/Views/ProfileDataGridNode.js	2016-04-25 00:27:30 UTC (rev 199970)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ProfileDataGridNode.js	2016-04-25 00:59:48 UTC (rev 199971)
@@ -32,7 +32,6 @@
         this._node = cctNode;
         this._tree = tree;
 
-        this._populated = false;
         this._childrenToChargeToSelf = new Set;
         this._extraSelfTimeFromChargedChildren = 0;
 
@@ -136,7 +135,7 @@
         let isBottomUp = this._tree.callingContextTree.type === WebInspector.CallingContextTree.Type.BottomUp;
         if (!this._tree.hasModifiers() || isBottomUp) {
             // Add back child data grid nodes that were previously charged to us.
-            if (this._populated && this._childrenToChargeToSelf.size) {
+            if (!this.shouldRefreshChildren && this._childrenToChargeToSelf.size) {
                 for (let child of this._childrenToChargeToSelf) {
                     console.assert(child.hasStackTraceInTimeRange(this._tree.startTime, this._tree.endTime));
                     this.appendChild(new WebInspector.ProfileDataGridNode(child, this._tree));
@@ -173,7 +172,7 @@
         this.hasChildren = hasNonChargedChild;
 
         // Remove child data grid nodes that have been charged to us.
-        if (this._populated && this._childrenToChargeToSelf.size) {
+        if (!this.shouldRefreshChildren && this._childrenToChargeToSelf.size) {
             for (let childDataGridNode of this.children) {
                 if (this._childrenToChargeToSelf.has(childDataGridNode.node))
                     this.removeChild(childDataGridNode);
@@ -238,7 +237,8 @@
 
     _populate()
     {
-        this._populated = true;
+        if (!this.shouldRefreshChildren)
+            return;
 
         this._node.forEachChild((child) => {
             if (!this._childrenToChargeToSelf.has(child)) {

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ProfileNodeDataGridNode.js (199970 => 199971)


--- trunk/Source/WebInspectorUI/UserInterface/Views/ProfileNodeDataGridNode.js	2016-04-25 00:27:30 UTC (rev 199970)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ProfileNodeDataGridNode.js	2016-04-25 00:59:48 UTC (rev 199971)
@@ -37,6 +37,8 @@
         this._rangeEndTime = typeof rangeEndTime === "number" ? rangeEndTime : Infinity;
 
         this._cachedData = null;
+
+        this.addEventListener("populate", this._populate, this);
     }
 
     // Public
@@ -172,4 +174,19 @@
 
         return [className];
     }
+
+    // Private
+
+    _populate()
+    {
+        if (!this.shouldRefreshChildren)
+            return;
+
+        this.removeChildren();
+
+        for (let node of this._profileNode.childNodes)
+            this.appendChild(new WebInspector.ProfileNodeDataGridNode(node, this.baseStartTime, this.rangeStartTime, this.rangeEndTime));
+
+        this.removeEventListener("populate", this._populate, this);
+    }
 };
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to