OLD | NEW |
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 CONTENT_CHILD_SCHEDULER_SCHEDULER_HELPER_H_ | 5 #ifndef COMPONENTS_SCHEDULER_CHILD_SCHEDULER_HELPER_H_ |
6 #define CONTENT_CHILD_SCHEDULER_SCHEDULER_HELPER_H_ | 6 #define COMPONENTS_SCHEDULER_CHILD_SCHEDULER_HELPER_H_ |
7 | 7 |
8 #include "content/child/scheduler/cancelable_closure_holder.h" | 8 #include "components/scheduler/child/cancelable_closure_holder.h" |
9 #include "content/child/scheduler/single_thread_idle_task_runner.h" | 9 #include "components/scheduler/child/single_thread_idle_task_runner.h" |
10 #include "content/child/scheduler/task_queue_manager.h" | 10 #include "components/scheduler/child/task_queue_manager.h" |
11 #include "content/child/scheduler/time_source.h" | 11 #include "components/scheduler/child/time_source.h" |
| 12 #include "components/scheduler/scheduler_export.h" |
12 | 13 |
13 namespace content { | 14 namespace scheduler { |
14 | 15 |
15 class PrioritizingTaskQueueSelector; | 16 class PrioritizingTaskQueueSelector; |
16 class NestableSingleThreadTaskRunner; | 17 class NestableSingleThreadTaskRunner; |
17 | 18 |
18 // Common scheduler functionality for Default and Idle tasks. | 19 // Common scheduler functionality for Default and Idle tasks. |
19 class CONTENT_EXPORT SchedulerHelper { | 20 class SCHEDULER_EXPORT SchedulerHelper { |
20 public: | 21 public: |
21 // Used to by scheduler implementations to customize idle behaviour. | 22 // Used to by scheduler implementations to customize idle behaviour. |
22 class CONTENT_EXPORT SchedulerHelperDelegate { | 23 class SCHEDULER_EXPORT SchedulerHelperDelegate { |
23 public: | 24 public: |
24 SchedulerHelperDelegate(); | 25 SchedulerHelperDelegate(); |
25 virtual ~SchedulerHelperDelegate(); | 26 virtual ~SchedulerHelperDelegate(); |
26 | 27 |
27 // If it's ok to enter a Long Idle period, return true. Otherwise return | 28 // If it's ok to enter a Long Idle period, return true. Otherwise return |
28 // false and set next_long_idle_period_delay_out so we know when to try | 29 // false and set next_long_idle_period_delay_out so we know when to try |
29 // again. | 30 // again. |
30 virtual bool CanEnterLongIdlePeriod( | 31 virtual bool CanEnterLongIdlePeriod( |
31 base::TimeTicks now, | 32 base::TimeTicks now, |
32 base::TimeDelta* next_long_idle_period_delay_out) = 0; | 33 base::TimeDelta* next_long_idle_period_delay_out) = 0; |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 const char* tracing_category_; | 203 const char* tracing_category_; |
203 const char* disabled_by_default_tracing_category_; | 204 const char* disabled_by_default_tracing_category_; |
204 const char* idle_period_tracing_name_; | 205 const char* idle_period_tracing_name_; |
205 | 206 |
206 base::WeakPtr<SchedulerHelper> weak_scheduler_ptr_; | 207 base::WeakPtr<SchedulerHelper> weak_scheduler_ptr_; |
207 base::WeakPtrFactory<SchedulerHelper> weak_factory_; | 208 base::WeakPtrFactory<SchedulerHelper> weak_factory_; |
208 | 209 |
209 DISALLOW_COPY_AND_ASSIGN(SchedulerHelper); | 210 DISALLOW_COPY_AND_ASSIGN(SchedulerHelper); |
210 }; | 211 }; |
211 | 212 |
212 } // namespace content | 213 } // namespace scheduler |
213 | 214 |
214 #endif // CONTENT_CHILD_SCHEDULER_SCHEDULER_HELPER_H_ | 215 #endif // COMPONENTS_SCHEDULER_CHILD_SCHEDULER_HELPER_H_ |
OLD | NEW |