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

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

Issue 1303353003: scheduler: Disable expensive timers during main thread user input (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments. Created 5 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_RENDERER_SCHEDULER_IMPL_H_ 5 #ifndef COMPONENTS_SCHEDULER_RENDERER_RENDERER_SCHEDULER_IMPL_H_
6 #define COMPONENTS_SCHEDULER_RENDERER_RENDERER_SCHEDULER_IMPL_H_ 6 #define COMPONENTS_SCHEDULER_RENDERER_RENDERER_SCHEDULER_IMPL_H_
7 7
8 #include "base/atomicops.h" 8 #include "base/atomicops.h"
9 #include "base/synchronization/lock.h" 9 #include "base/synchronization/lock.h"
10 #include "components/scheduler/child/idle_helper.h" 10 #include "components/scheduler/child/idle_helper.h"
11 #include "components/scheduler/child/pollable_thread_safe_flag.h" 11 #include "components/scheduler/child/pollable_thread_safe_flag.h"
12 #include "components/scheduler/child/scheduler_helper.h" 12 #include "components/scheduler/child/scheduler_helper.h"
13 #include "components/scheduler/renderer/deadline_task_runner.h" 13 #include "components/scheduler/renderer/deadline_task_runner.h"
14 #include "components/scheduler/renderer/renderer_scheduler.h" 14 #include "components/scheduler/renderer/renderer_scheduler.h"
15 #include "components/scheduler/renderer/task_cost_estimator.h"
15 #include "components/scheduler/scheduler_export.h" 16 #include "components/scheduler/scheduler_export.h"
16 17
17 namespace base { 18 namespace base {
18 namespace trace_event { 19 namespace trace_event {
19 class ConvertableToTraceFormat; 20 class ConvertableToTraceFormat;
20 } 21 }
21 } 22 }
22 23
23 namespace scheduler { 24 namespace scheduler {
24 25
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 192
192 base::Closure update_policy_closure_; 193 base::Closure update_policy_closure_;
193 DeadlineTaskRunner delayed_update_policy_runner_; 194 DeadlineTaskRunner delayed_update_policy_runner_;
194 CancelableClosureHolder end_renderer_hidden_idle_period_closure_; 195 CancelableClosureHolder end_renderer_hidden_idle_period_closure_;
195 196
196 // We have decided to improve thread safety at the cost of some boilerplate 197 // We have decided to improve thread safety at the cost of some boilerplate
197 // (the accessors) for the following data members. 198 // (the accessors) for the following data members.
198 199
199 struct MainThreadOnly { 200 struct MainThreadOnly {
200 MainThreadOnly(); 201 MainThreadOnly();
202 ~MainThreadOnly();
201 203
204 TaskCostEstimator timer_task_cost_estimator_;
205 cc::RollingTimeDeltaHistory short_idle_period_duration_;
202 Policy current_policy_; 206 Policy current_policy_;
203 base::TimeTicks current_policy_expiration_time_; 207 base::TimeTicks current_policy_expiration_time_;
204 base::TimeTicks estimated_next_frame_begin_; 208 base::TimeTicks estimated_next_frame_begin_;
209 base::TimeDelta expected_short_idle_period_duration_;
205 int timer_queue_suspend_count_; // TIMER_TASK_QUEUE suspended if non-zero. 210 int timer_queue_suspend_count_; // TIMER_TASK_QUEUE suspended if non-zero.
206 bool renderer_hidden_; 211 bool renderer_hidden_;
207 bool was_shutdown_; 212 bool was_shutdown_;
208 }; 213 };
209 214
210 struct AnyThread { 215 struct AnyThread {
211 AnyThread(); 216 AnyThread();
212 217
213 base::TimeTicks last_input_signal_time_; 218 base::TimeTicks last_input_signal_time_;
214 base::TimeTicks last_idle_period_end_time_; 219 base::TimeTicks last_idle_period_end_time_;
215 base::TimeTicks rails_loading_priority_deadline_; 220 base::TimeTicks rails_loading_priority_deadline_;
216 int pending_main_thread_input_event_count_; 221 int pending_main_thread_input_event_count_;
217 bool awaiting_touch_start_response_; 222 bool awaiting_touch_start_response_;
218 bool in_idle_period_; 223 bool in_idle_period_;
219 bool begin_main_frame_on_critical_path_; 224 bool begin_main_frame_on_critical_path_;
225 bool timer_tasks_seem_expensive_;
220 }; 226 };
221 227
222 struct CompositorThreadOnly { 228 struct CompositorThreadOnly {
223 CompositorThreadOnly(); 229 CompositorThreadOnly();
224 ~CompositorThreadOnly(); 230 ~CompositorThreadOnly();
225 231
226 blink::WebInputEvent::Type last_input_type_; 232 blink::WebInputEvent::Type last_input_type_;
227 scoped_ptr<base::ThreadChecker> compositor_thread_checker_; 233 scoped_ptr<base::ThreadChecker> compositor_thread_checker_;
228 234
229 void CheckOnValidThread() { 235 void CheckOnValidThread() {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 275
270 PollableThreadSafeFlag policy_may_need_update_; 276 PollableThreadSafeFlag policy_may_need_update_;
271 base::WeakPtrFactory<RendererSchedulerImpl> weak_factory_; 277 base::WeakPtrFactory<RendererSchedulerImpl> weak_factory_;
272 278
273 DISALLOW_COPY_AND_ASSIGN(RendererSchedulerImpl); 279 DISALLOW_COPY_AND_ASSIGN(RendererSchedulerImpl);
274 }; 280 };
275 281
276 } // namespace scheduler 282 } // namespace scheduler
277 283
278 #endif // COMPONENTS_SCHEDULER_RENDERER_RENDERER_SCHEDULER_IMPL_H_ 284 #endif // COMPONENTS_SCHEDULER_RENDERER_RENDERER_SCHEDULER_IMPL_H_
OLDNEW
« no previous file with comments | « components/scheduler/renderer/DEPS ('k') | components/scheduler/renderer/renderer_scheduler_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698