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

Side by Side Diff: Source/devtools/front_end/timeline/TimelineUIUtils.js

Issue 429883004: DevTools: add pie chart to the paint profiler overview. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebaselined Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * Copyright (C) 2012 Intel Inc. All rights reserved. 3 * Copyright (C) 2012 Intel Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 element.className = "timeline-aggregated-info"; 245 element.className = "timeline-aggregated-info";
246 246
247 var total = 0; 247 var total = 0;
248 for (var categoryName in aggregatedStats) 248 for (var categoryName in aggregatedStats)
249 total += aggregatedStats[categoryName]; 249 total += aggregatedStats[categoryName];
250 250
251 function formatter(value) 251 function formatter(value)
252 { 252 {
253 return Number.millisToString(value, true); 253 return Number.millisToString(value, true);
254 } 254 }
255 var pieChart = new WebInspector.PieChart(total, formatter); 255 var pieChart = new WebInspector.PieChart(100, formatter);
256 pieChart.setTotal(total);
256 element.appendChild(pieChart.element); 257 element.appendChild(pieChart.element);
257 var footerElement = element.createChild("div", "timeline-aggregated-info-leg end"); 258 var footerElement = element.createChild("div", "timeline-aggregated-info-leg end");
258 259
259 // In case of self time, first add self, then children of the same category. 260 // In case of self time, first add self, then children of the same category.
260 if (selfCategory && selfTime) { 261 if (selfCategory && selfTime) {
261 // Self. 262 // Self.
262 pieChart.addSlice(selfTime, selfCategory.fillColorStop1); 263 pieChart.addSlice(selfTime, selfCategory.fillColorStop1);
263 var rowElement = footerElement.createChild("div"); 264 var rowElement = footerElement.createChild("div");
264 rowElement.createChild("div", "timeline-aggregated-category timeline-" + selfCategory.name); 265 rowElement.createChild("div", "timeline-aggregated-category timeline-" + selfCategory.name);
265 rowElement.createTextChild(WebInspector.UIString("%s %s (Self)", formatt er(selfTime), selfCategory.title)); 266 rowElement.createTextChild(WebInspector.UIString("%s %s (Self)", formatt er(selfTime), selfCategory.title));
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 for (var i = 0; i < stackTrace.length; ++i) { 568 for (var i = 0; i < stackTrace.length; ++i) {
568 var stackFrame = stackTrace[i]; 569 var stackFrame = stackTrace[i];
569 var row = stackTraceElement.createChild("div"); 570 var row = stackTraceElement.createChild("div");
570 row.createTextChild(stackFrame.functionName || WebInspector.UIString ("(anonymous function)")); 571 row.createTextChild(stackFrame.functionName || WebInspector.UIString ("(anonymous function)"));
571 row.createTextChild(" @ "); 572 row.createTextChild(" @ ");
572 var urlElement = this._linkifier.linkifyScriptLocation(this._target, stackFrame.scriptId, stackFrame.url, stackFrame.lineNumber - 1, stackFrame.colu mnNumber - 1); 573 var urlElement = this._linkifier.linkifyScriptLocation(this._target, stackFrame.scriptId, stackFrame.url, stackFrame.lineNumber - 1, stackFrame.colu mnNumber - 1);
573 row.appendChild(urlElement); 574 row.appendChild(urlElement);
574 } 575 }
575 } 576 }
576 } 577 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/timeline/PaintProfilerView.js ('k') | Source/devtools/front_end/ui/PieChart.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698