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

Side by Side Diff: components/scheduler/child/scheduler_helper.h

Issue 1238483003: Revert of Redirect the MessageLoop's task runner to the renderer scheduler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 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 SchedulerTaskRunnerDelegate; 18 class NestableSingleThreadTaskRunner;
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(scoped_refptr<SchedulerTaskRunnerDelegate> main_task_runner, 26 SchedulerHelper(
27 const char* tracing_category, 27 scoped_refptr<NestableSingleThreadTaskRunner> main_task_runner,
28 const char* disabled_by_default_tracing_category, 28 const char* tracing_category,
29 const char* disabled_by_default_verbose_tracing_category, 29 const char* disabled_by_default_tracing_category,
30 size_t total_task_queue_count); 30 const char* disabled_by_default_verbose_tracing_category,
31 size_t total_task_queue_count);
31 ~SchedulerHelper(); 32 ~SchedulerHelper();
32 33
33 // Returns the default task runner. 34 // Returns the default task runner.
34 scoped_refptr<base::SingleThreadTaskRunner> DefaultTaskRunner(); 35 scoped_refptr<base::SingleThreadTaskRunner> DefaultTaskRunner();
35 36
36 // Returns the control task runner. Tasks posted to this runner are executed 37 // Returns the control task runner. Tasks posted to this runner are executed
37 // with the highest priority. Care must be taken to avoid starvation of other 38 // with the highest priority. Care must be taken to avoid starvation of other
38 // task queues. 39 // task queues.
39 scoped_refptr<base::SingleThreadTaskRunner> ControlTaskRunner(); 40 scoped_refptr<base::SingleThreadTaskRunner> ControlTaskRunner();
40 41
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 98
98 // Test helpers. 99 // Test helpers.
99 void SetTimeSourceForTesting(scoped_ptr<base::TickClock> time_source); 100 void SetTimeSourceForTesting(scoped_ptr<base::TickClock> time_source);
100 void SetWorkBatchSizeForTesting(size_t work_batch_size); 101 void SetWorkBatchSizeForTesting(size_t work_batch_size);
101 TaskQueueManager* GetTaskQueueManagerForTesting(); 102 TaskQueueManager* GetTaskQueueManagerForTesting();
102 103
103 private: 104 private:
104 friend class SchedulerHelperTest; 105 friend class SchedulerHelperTest;
105 106
106 base::ThreadChecker thread_checker_; 107 base::ThreadChecker thread_checker_;
107 scoped_refptr<SchedulerTaskRunnerDelegate> main_task_runner_;
108 scoped_ptr<PrioritizingTaskQueueSelector> task_queue_selector_; 108 scoped_ptr<PrioritizingTaskQueueSelector> task_queue_selector_;
109 scoped_ptr<TaskQueueManager> task_queue_manager_; 109 scoped_ptr<TaskQueueManager> task_queue_manager_;
110 110
111 uint64 quiescence_monitored_task_queue_mask_; 111 uint64 quiescence_monitored_task_queue_mask_;
112 112
113 scoped_refptr<base::SingleThreadTaskRunner> control_task_runner_; 113 scoped_refptr<base::SingleThreadTaskRunner> control_task_runner_;
114 scoped_refptr<base::SingleThreadTaskRunner> control_after_wakeup_task_runner_; 114 scoped_refptr<base::SingleThreadTaskRunner> control_after_wakeup_task_runner_;
115 scoped_refptr<base::SingleThreadTaskRunner> default_task_runner_; 115 scoped_refptr<base::SingleThreadTaskRunner> default_task_runner_;
116 116
117 scoped_ptr<base::TickClock> time_source_; 117 scoped_ptr<base::TickClock> time_source_;
118 118
119 const char* tracing_category_; 119 const char* tracing_category_;
120 const char* disabled_by_default_tracing_category_; 120 const char* disabled_by_default_tracing_category_;
121 121
122 DISALLOW_COPY_AND_ASSIGN(SchedulerHelper); 122 DISALLOW_COPY_AND_ASSIGN(SchedulerHelper);
123 }; 123 };
124 124
125 } // namespace scheduler 125 } // namespace scheduler
126 126
127 #endif // COMPONENTS_SCHEDULER_CHILD_SCHEDULER_HELPER_H_ 127 #endif // COMPONENTS_SCHEDULER_CHILD_SCHEDULER_HELPER_H_
OLDNEW
« no previous file with comments | « components/scheduler/child/nestable_task_runner_for_test.cc ('k') | components/scheduler/child/scheduler_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698