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 COMPONENTS_SCHEDULER_CHILD_SCHEDULER_HELPER_H_ | 5 #ifndef COMPONENTS_SCHEDULER_CHILD_SCHEDULER_HELPER_H_ |
6 #define COMPONENTS_SCHEDULER_CHILD_SCHEDULER_HELPER_H_ | 6 #define COMPONENTS_SCHEDULER_CHILD_SCHEDULER_HELPER_H_ |
7 | 7 |
8 #include "components/scheduler/child/prioritizing_task_queue_selector.h" | 8 #include "components/scheduler/child/prioritizing_task_queue_selector.h" |
9 #include "components/scheduler/child/task_queue_manager.h" | 9 #include "components/scheduler/child/task_queue_manager.h" |
10 #include "components/scheduler/scheduler_export.h" | 10 #include "components/scheduler/scheduler_export.h" |
11 | 11 |
12 namespace base { | 12 namespace base { |
13 class TickClock; | 13 class TickClock; |
14 } | 14 } |
15 | 15 |
16 namespace scheduler { | 16 namespace scheduler { |
17 | 17 |
18 class NestableSingleThreadTaskRunner; | 18 class SchedulerTaskRunnerDelegate; |
19 | 19 |
20 // Common scheduler functionality for default tasks. | 20 // Common scheduler functionality for default tasks. |
21 class SCHEDULER_EXPORT SchedulerHelper { | 21 class SCHEDULER_EXPORT SchedulerHelper { |
22 public: | 22 public: |
23 // NOTE |total_task_queue_count| must be >= TASK_QUEUE_COUNT. | 23 // NOTE |total_task_queue_count| must be >= TASK_QUEUE_COUNT. |
24 // Category strings must have application lifetime (statics or | 24 // Category strings must have application lifetime (statics or |
25 // literals). They may not include " chars. | 25 // literals). They may not include " chars. |
26 SchedulerHelper( | 26 SchedulerHelper(scoped_refptr<SchedulerTaskRunnerDelegate> main_task_runner, |
27 scoped_refptr<NestableSingleThreadTaskRunner> main_task_runner, | 27 const char* tracing_category, |
28 const char* tracing_category, | 28 const char* disabled_by_default_tracing_category, |
29 const char* disabled_by_default_tracing_category, | 29 const char* disabled_by_default_verbose_tracing_category, |
30 const char* disabled_by_default_verbose_tracing_category, | 30 size_t total_task_queue_count); |
31 size_t total_task_queue_count); | |
32 ~SchedulerHelper(); | 31 ~SchedulerHelper(); |
33 | 32 |
34 // Returns the default task runner. | 33 // Returns the default task runner. |
35 scoped_refptr<base::SingleThreadTaskRunner> DefaultTaskRunner(); | 34 scoped_refptr<base::SingleThreadTaskRunner> DefaultTaskRunner(); |
36 | 35 |
37 // Returns the control task runner. Tasks posted to this runner are executed | 36 // Returns the control task runner. Tasks posted to this runner are executed |
38 // with the highest priority. Care must be taken to avoid starvation of other | 37 // with the highest priority. Care must be taken to avoid starvation of other |
39 // task queues. | 38 // task queues. |
40 scoped_refptr<base::SingleThreadTaskRunner> ControlTaskRunner(); | 39 scoped_refptr<base::SingleThreadTaskRunner> ControlTaskRunner(); |
41 | 40 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 | 117 |
119 const char* tracing_category_; | 118 const char* tracing_category_; |
120 const char* disabled_by_default_tracing_category_; | 119 const char* disabled_by_default_tracing_category_; |
121 | 120 |
122 DISALLOW_COPY_AND_ASSIGN(SchedulerHelper); | 121 DISALLOW_COPY_AND_ASSIGN(SchedulerHelper); |
123 }; | 122 }; |
124 | 123 |
125 } // namespace scheduler | 124 } // namespace scheduler |
126 | 125 |
127 #endif // COMPONENTS_SCHEDULER_CHILD_SCHEDULER_HELPER_H_ | 126 #endif // COMPONENTS_SCHEDULER_CHILD_SCHEDULER_HELPER_H_ |
OLD | NEW |