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

Unified Diff: Source/devtools/front_end/TimelinePanel.js

Issue 220963002: DevTools: Add energy value under Timeline pie chart (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 8 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
« no previous file with comments | « no previous file | Source/devtools/front_end/TimelinePowerOverview.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/TimelinePanel.js
diff --git a/Source/devtools/front_end/TimelinePanel.js b/Source/devtools/front_end/TimelinePanel.js
index 69e664aa5c0acb8feb9f3f6bc2e22f5b0aecf3ff..5a92bc0ddd92914d23092b80fff66ec52b5b7cca 100644
--- a/Source/devtools/front_end/TimelinePanel.js
+++ b/Source/devtools/front_end/TimelinePanel.js
@@ -895,6 +895,12 @@ WebInspector.TimelinePanel.prototype = {
var startOffset = startTime - this._model.minimumRecordTime();
var endOffset = endTime - this._model.minimumRecordTime();
var title = WebInspector.UIString("%s \u2013 %s", Number.millisToString(startOffset), Number.millisToString(endOffset));
+
+ if (Capabilities.canProfilePower) {
+ var powerOverview = /** @type {!WebInspector.TimelinePowerOverview} */ (this._viewsForMode(WebInspector.TimelinePanel.Mode.Power).overviewView);
+ energy = powerOverview.calculateEnergy(startTime, endTime);
+ title += WebInspector.UIString(" Energy: %.2f Joules", energy);
+ }
this._detailsView.setContent(title, fragment);
},
« no previous file with comments | « no previous file | Source/devtools/front_end/TimelinePowerOverview.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698