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

Side by Side Diff: components/scheduler/renderer/idle_time_estimator.h

Issue 1409073002: Make IdleTimeEstimator ignore nested tasks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Needs to be DCHECK_GE Created 5 years, 2 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
« no previous file with comments | « no previous file | components/scheduler/renderer/idle_time_estimator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_SCHEDULER_RENDERER_IDLE_TIME_ESTIMATOR_H_ 5 #ifndef COMPONENTS_SCHEDULER_RENDERER_IDLE_TIME_ESTIMATOR_H_
6 #define COMPONENTS_SCHEDULER_RENDERER_IDLE_TIME_ESTIMATOR_H_ 6 #define COMPONENTS_SCHEDULER_RENDERER_IDLE_TIME_ESTIMATOR_H_
7 7
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/time/tick_clock.h" 9 #include "base/time/tick_clock.h"
10 #include "cc/base/rolling_time_delta_history.h" 10 #include "cc/base/rolling_time_delta_history.h"
11 #include "components/scheduler/base/task_queue.h" 11 #include "components/scheduler/base/task_queue.h"
12 #include "components/scheduler/scheduler_export.h" 12 #include "components/scheduler/scheduler_export.h"
13 13
14 namespace scheduler { 14 namespace scheduler {
15 15
16 // Estimates how much idle time there is available. 16 // Estimates how much idle time there is available. Ignores nested tasks.
17 class SCHEDULER_EXPORT IdleTimeEstimator 17 class SCHEDULER_EXPORT IdleTimeEstimator
18 : public base::MessageLoop::TaskObserver { 18 : public base::MessageLoop::TaskObserver {
19 public: 19 public:
20 IdleTimeEstimator(const scoped_refptr<TaskQueue>& compositor_task_runner, 20 IdleTimeEstimator(const scoped_refptr<TaskQueue>& compositor_task_runner,
21 int sample_count, 21 int sample_count,
22 double estimation_percentile); 22 double estimation_percentile);
23 23
24 ~IdleTimeEstimator() override; 24 ~IdleTimeEstimator() override;
25 25
26 // Expected Idle time is defined as: |compositor_frame_interval| minus 26 // Expected Idle time is defined as: |compositor_frame_interval| minus
(...skipping 22 matching lines...) Expand all
49 base::TimeDelta cumulative_compositor_runtime_; 49 base::TimeDelta cumulative_compositor_runtime_;
50 int nesting_level_; 50 int nesting_level_;
51 bool did_commit_; 51 bool did_commit_;
52 52
53 DISALLOW_COPY_AND_ASSIGN(IdleTimeEstimator); 53 DISALLOW_COPY_AND_ASSIGN(IdleTimeEstimator);
54 }; 54 };
55 55
56 } // namespace scheduler 56 } // namespace scheduler
57 57
58 #endif // COMPONENTS_SCHEDULER_RENDERER_IDLE_TIME_ESTIMATOR_H_ 58 #endif // COMPONENTS_SCHEDULER_RENDERER_IDLE_TIME_ESTIMATOR_H_
OLDNEW
« no previous file with comments | « no previous file | components/scheduler/renderer/idle_time_estimator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698