summaryrefslogtreecommitdiff
path: root/src/3rdparty/webkit/WebCore/inspector/front-end/BottomUpProfileDataGridTree.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/webkit/WebCore/inspector/front-end/BottomUpProfileDataGridTree.js')
-rw-r--r--src/3rdparty/webkit/WebCore/inspector/front-end/BottomUpProfileDataGridTree.js22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/3rdparty/webkit/WebCore/inspector/front-end/BottomUpProfileDataGridTree.js b/src/3rdparty/webkit/WebCore/inspector/front-end/BottomUpProfileDataGridTree.js
index 41a8a3aaee..5aaae0cde7 100644
--- a/src/3rdparty/webkit/WebCore/inspector/front-end/BottomUpProfileDataGridTree.js
+++ b/src/3rdparty/webkit/WebCore/inspector/front-end/BottomUpProfileDataGridTree.js
@@ -31,11 +31,7 @@
WebInspector.BottomUpProfileDataGridNode = function(/*ProfileView*/ profileView, /*ProfileNode*/ profileNode, /*BottomUpProfileDataGridTree*/ owningTree)
{
- // In bottom up mode, our parents are our children since we display an inverted tree.
- // However, we don't want to show the very top parent since it is redundant.
- var hasChildren = !!(profileNode.parent && profileNode.parent.parent);
-
- WebInspector.ProfileDataGridNode.call(this, profileView, profileNode, owningTree, hasChildren);
+ WebInspector.ProfileDataGridNode.call(this, profileView, profileNode, owningTree, this._willHaveChildren(profileNode));
this._remainingNodeInfos = [];
}
@@ -78,6 +74,14 @@ WebInspector.BottomUpProfileDataGridNode.prototype = {
this._merge(child, true);
},
+ _restore: function()
+ {
+ WebInspector.ProfileDataGridNode.prototype._restore();
+
+ if (!this.children.length)
+ this.hasChildren = this._willHaveChildren();
+ },
+
_merge: function(/*ProfileDataGridNode*/ child, /*Boolean*/ shouldAbsorb)
{
this.selfTime -= child.selfTime;
@@ -128,6 +132,14 @@ WebInspector.BottomUpProfileDataGridNode.prototype = {
}
delete this._remainingNodeInfos;
+ },
+
+ _willHaveChildren: function(profileNode)
+ {
+ profileNode = profileNode || this.profileNode;
+ // In bottom up mode, our parents are our children since we display an inverted tree.
+ // However, we don't want to show the very top parent since it is redundant.
+ return !!(profileNode.parent && profileNode.parent.parent);
}
}