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

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

Issue 1144963002: Timeline: visually distinguish idle frames (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: review comments Created 5 years, 6 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/TimelineFrameOverview.js
diff --git a/Source/devtools/front_end/timeline/TimelineFrameOverview.js b/Source/devtools/front_end/timeline/TimelineFrameOverview.js
index 80cc6d92b4d8a59085b705d48e2d82617f2f37b5..72b3eb29653432c76d3f002ef62be005b9a5f476 100644
--- a/Source/devtools/front_end/timeline/TimelineFrameOverview.js
+++ b/Source/devtools/front_end/timeline/TimelineFrameOverview.js
@@ -202,13 +202,14 @@ WebInspector.TimelineFrameOverview.prototype = {
for (var barIndex = 0, currentFrame = 0; currentFrame < frames.length; ++barIndex) {
var barStartTime = frames[currentFrame].startTime;
var longestFrame = null;
- var longestDuration = 0;
+ var longestDuration;
for (var lastFrame = Math.min(Math.floor((barIndex + 1) * framesPerBar), frames.length);
currentFrame < lastFrame; ++currentFrame) {
- var duration = frames[currentFrame].duration;
+ var frame = frames[currentFrame];
+ var duration = frame.idle ? 0 : frame.duration; // Only consider idle frames if there are no regular frames.
if (!longestFrame || longestDuration < duration) {
- longestFrame = frames[currentFrame];
+ longestFrame = frame;
longestDuration = duration;
}
}
@@ -351,8 +352,12 @@ WebInspector.TimelineFrameOverview.prototype = {
bottomOffset -= height;
}
+ // Skip outline for idle frames, unless frame is selected.
+ if (frame.idle && index !== this._activeBarIndex)
+ return;
+
// Draw a contour for the total frame time.
- var y0 = Math.floor(windowHeight - frame.duration * this._scale) + 0.5;
+ var y0 = frame.idle ? bottomOffset + 0.5 : Math.floor(windowHeight - frame.duration * this._scale) + 0.5;
var y1 = windowHeight + 0.5;
this._context.strokeStyle = index === this._activeBarIndex ? "rgba(0, 0, 0, 0.6)" : "rgba(90, 90, 90, 0.2)";
« no previous file with comments | « Source/devtools/front_end/timeline/TimelineFrameModel.js ('k') | Source/devtools/front_end/timeline/TimelineModel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698