Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1392)

Unified Diff: Source/devtools/front_end/timeline/TimelineModel.js

Issue 1292943002: DevTools: Add total time column to the timeline tree view (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: addressing comment Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/devtools/front_end/timeline/TimelineModel.js
diff --git a/Source/devtools/front_end/timeline/TimelineModel.js b/Source/devtools/front_end/timeline/TimelineModel.js
index 16b07e5a5e1c73aaff4a812d5e7fab2eaa4d4043..51722814e375deeec817ce15a3a07a02d1a79e47 100644
--- a/Source/devtools/front_end/timeline/TimelineModel.js
+++ b/Source/devtools/front_end/timeline/TimelineModel.js
@@ -1561,6 +1561,7 @@ WebInspector.TimelineModel.buildTopDownTree = function(events, startTime, endTim
WebInspector.TimelineModel.buildBottomUpTree = function(topDownTree, groupingCallback)
{
var buRoot = new WebInspector.TimelineModel.ProfileTreeNode();
+ buRoot.selfTime = 0;
buRoot.totalTime = 0;
buRoot.name = WebInspector.UIString("Bottom-Up Chart");
/** @type {!Map<string,!WebInspector.TimelineModel.ProfileTreeNode>} */
@@ -1586,8 +1587,10 @@ WebInspector.TimelineModel.buildBottomUpTree = function(topDownTree, groupingCal
*/
function appendNode(tdNode, buParent)
{
- var time = tdNode.selfTime;
- buParent.totalTime += time;
+ var selfTime = tdNode.selfTime;
+ var totalTime = tdNode.totalTime;
+ buParent.selfTime += selfTime;
+ buParent.totalTime += selfTime;
while (tdNode.parent) {
if (!buParent.children)
buParent.children = /** @type {!Map<string,!WebInspector.TimelineModel.ProfileTreeNode>} */ (new Map());
@@ -1595,13 +1598,15 @@ WebInspector.TimelineModel.buildBottomUpTree = function(topDownTree, groupingCal
var buNode = buParent.children.get(id);
if (!buNode) {
buNode = new WebInspector.TimelineModel.ProfileTreeNode();
- buNode.totalTime = time;
+ buNode.selfTime = selfTime;
+ buNode.totalTime = totalTime;
buNode.name = tdNode.name;
buNode.event = tdNode.event;
buNode.id = id;
buParent.children.set(id, buNode);
} else {
- buNode.totalTime += time;
+ buNode.selfTime += selfTime;
+ buNode.totalTime += totalTime;
}
tdNode = tdNode.parent;
buParent = buNode;

Powered by Google App Engine
This is Rietveld 408576698