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

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

Issue 423433004: DevTools: move the "Capture *" checkboxes from timeline sidebar to the toolbar. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebaselined Created 6 years, 5 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 | « Source/devtools/front_end/inspectorStyle.css ('k') | Source/devtools/front_end/timeline/TimelineModel.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 0672b6b281ecc0060dad63f3b04e00b94f8636a3..399a2fb5c412fe38ba0a05f9dad4be0b45d62ffb 100644
--- a/Source/devtools/front_end/timeline/TimelineFrameOverview.js
+++ b/Source/devtools/front_end/timeline/TimelineFrameOverview.js
@@ -136,6 +136,11 @@ WebInspector.TimelineFrameOverview.prototype = {
*/
_computeTargetFrameLength: function(frames)
{
+ const targetFPS = 20;
+ var result = 1000.0 / targetFPS;
+ if (!frames.length)
+ return result;
+
var durations = [];
for (var i = 0; i < frames.length; ++i) {
if (frames[i])
@@ -145,8 +150,6 @@ WebInspector.TimelineFrameOverview.prototype = {
// Optimize appearance for 30fps, but leave some space so it's evident when a frame overflows.
// However, if at least half frames won't fit at this scale, fall back to using autoscale.
- const targetFPS = 20;
- var result = 1000.0 / targetFPS;
if (result >= medianFrameLength)
return result;
« no previous file with comments | « Source/devtools/front_end/inspectorStyle.css ('k') | Source/devtools/front_end/timeline/TimelineModel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698