| OLD | NEW |
| 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/base/pollable_thread_safe_flag.h" | 10 #include "components/scheduler/base/pollable_thread_safe_flag.h" |
| 11 #include "components/scheduler/child/idle_helper.h" | 11 #include "components/scheduler/child/idle_helper.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/idle_time_estimator.h" |
| 14 #include "components/scheduler/renderer/renderer_scheduler.h" | 15 #include "components/scheduler/renderer/renderer_scheduler.h" |
| 15 #include "components/scheduler/renderer/task_cost_estimator.h" | 16 #include "components/scheduler/renderer/task_cost_estimator.h" |
| 16 #include "components/scheduler/renderer/user_model.h" | 17 #include "components/scheduler/renderer/user_model.h" |
| 17 #include "components/scheduler/scheduler_export.h" | 18 #include "components/scheduler/scheduler_export.h" |
| 18 | 19 |
| 19 namespace base { | 20 namespace base { |
| 20 namespace trace_event { | 21 namespace trace_event { |
| 21 class ConvertableToTraceFormat; | 22 class ConvertableToTraceFormat; |
| 22 } | 23 } |
| 23 } | 24 } |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 | 228 |
| 228 // We have decided to improve thread safety at the cost of some boilerplate | 229 // We have decided to improve thread safety at the cost of some boilerplate |
| 229 // (the accessors) for the following data members. | 230 // (the accessors) for the following data members. |
| 230 | 231 |
| 231 struct MainThreadOnly { | 232 struct MainThreadOnly { |
| 232 MainThreadOnly(); | 233 MainThreadOnly(); |
| 233 ~MainThreadOnly(); | 234 ~MainThreadOnly(); |
| 234 | 235 |
| 235 TaskCostEstimator loading_task_cost_estimator; | 236 TaskCostEstimator loading_task_cost_estimator; |
| 236 TaskCostEstimator timer_task_cost_estimator; | 237 TaskCostEstimator timer_task_cost_estimator; |
| 237 cc::RollingTimeDeltaHistory short_idle_period_duration; | 238 IdleTimeEstimator idle_time_estimator; |
| 238 UseCase current_use_case; | 239 UseCase current_use_case; |
| 239 Policy current_policy; | 240 Policy current_policy; |
| 240 base::TimeTicks current_policy_expiration_time; | 241 base::TimeTicks current_policy_expiration_time; |
| 241 base::TimeTicks estimated_next_frame_begin; | 242 base::TimeTicks estimated_next_frame_begin; |
| 242 base::TimeDelta expected_short_idle_period_duration; | |
| 243 int timer_queue_suspend_count; // TIMER_TASK_QUEUE suspended if non-zero. | 243 int timer_queue_suspend_count; // TIMER_TASK_QUEUE suspended if non-zero. |
| 244 int navigation_task_expected_count; | 244 int navigation_task_expected_count; |
| 245 bool renderer_hidden; | 245 bool renderer_hidden; |
| 246 bool renderer_backgrounded; | 246 bool renderer_backgrounded; |
| 247 bool timer_queue_suspension_when_backgrounded_enabled; | 247 bool timer_queue_suspension_when_backgrounded_enabled; |
| 248 bool timer_queue_suspended_when_backgrounded; | 248 bool timer_queue_suspended_when_backgrounded; |
| 249 bool was_shutdown; | 249 bool was_shutdown; |
| 250 bool loading_tasks_seem_expensive; | 250 bool loading_tasks_seem_expensive; |
| 251 bool timer_tasks_seem_expensive; | 251 bool timer_tasks_seem_expensive; |
| 252 bool touchstart_expected_soon; | 252 bool touchstart_expected_soon; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 | 314 |
| 315 PollableThreadSafeFlag policy_may_need_update_; | 315 PollableThreadSafeFlag policy_may_need_update_; |
| 316 base::WeakPtrFactory<RendererSchedulerImpl> weak_factory_; | 316 base::WeakPtrFactory<RendererSchedulerImpl> weak_factory_; |
| 317 | 317 |
| 318 DISALLOW_COPY_AND_ASSIGN(RendererSchedulerImpl); | 318 DISALLOW_COPY_AND_ASSIGN(RendererSchedulerImpl); |
| 319 }; | 319 }; |
| 320 | 320 |
| 321 } // namespace scheduler | 321 } // namespace scheduler |
| 322 | 322 |
| 323 #endif // COMPONENTS_SCHEDULER_RENDERER_RENDERER_SCHEDULER_IMPL_H_ | 323 #endif // COMPONENTS_SCHEDULER_RENDERER_RENDERER_SCHEDULER_IMPL_H_ |
| OLD | NEW |