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 "base/time/tick_clock.h" | 8 #include "base/time/tick_clock.h" |
9 #include "components/scheduler/base/task_queue_manager.h" | 9 #include "components/scheduler/base/task_queue_manager.h" |
10 #include "components/scheduler/base/task_queue_selector.h" | 10 #include "components/scheduler/base/task_queue_selector.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 virtual void OnUnregisterTaskQueue( | 76 virtual void OnUnregisterTaskQueue( |
77 const scoped_refptr<TaskQueue>& queue) = 0; | 77 const scoped_refptr<TaskQueue>& queue) = 0; |
78 }; | 78 }; |
79 | 79 |
80 // Called once to set the Observer. This function is called on the main | 80 // Called once to set the Observer. This function is called on the main |
81 // thread. If |observer| is null, then no callbacks will occur. | 81 // thread. If |observer| is null, then no callbacks will occur. |
82 // Note |observer| is expected to outlive the SchedulerHelper. | 82 // Note |observer| is expected to outlive the SchedulerHelper. |
83 void SetObserver(Observer* observer); | 83 void SetObserver(Observer* observer); |
84 | 84 |
85 // Accessor methods. | 85 // Accessor methods. |
86 RealTimeDomain* real_time_domain() const; | 86 const scoped_refptr<RealTimeDomain>& real_time_domain() const; |
87 void RegisterTimeDomain(TimeDomain* time_domain); | |
88 void UnregisterTimeDomain(TimeDomain* time_domain); | |
89 const scoped_refptr<SchedulerTqmDelegate>& scheduler_tqm_delegate() const; | 87 const scoped_refptr<SchedulerTqmDelegate>& scheduler_tqm_delegate() const; |
90 bool GetAndClearSystemIsQuiescentBit(); | 88 bool GetAndClearSystemIsQuiescentBit(); |
91 | 89 |
92 // Test helpers. | 90 // Test helpers. |
93 void SetWorkBatchSizeForTesting(size_t work_batch_size); | 91 void SetWorkBatchSizeForTesting(size_t work_batch_size); |
94 TaskQueueManager* GetTaskQueueManagerForTesting(); | 92 TaskQueueManager* GetTaskQueueManagerForTesting(); |
95 | 93 |
96 private: | 94 private: |
97 friend class SchedulerHelperTest; | 95 friend class SchedulerHelperTest; |
98 | 96 |
99 base::ThreadChecker thread_checker_; | 97 base::ThreadChecker thread_checker_; |
100 scoped_refptr<SchedulerTqmDelegate> task_queue_manager_delegate_; | 98 scoped_refptr<SchedulerTqmDelegate> task_queue_manager_delegate_; |
101 scoped_ptr<TaskQueueManager> task_queue_manager_; | 99 scoped_ptr<TaskQueueManager> task_queue_manager_; |
102 scoped_refptr<TaskQueue> control_task_runner_; | 100 scoped_refptr<TaskQueue> control_task_runner_; |
103 scoped_refptr<TaskQueue> control_after_wakeup_task_runner_; | 101 scoped_refptr<TaskQueue> control_after_wakeup_task_runner_; |
104 scoped_refptr<TaskQueue> default_task_runner_; | 102 scoped_refptr<TaskQueue> default_task_runner_; |
105 | 103 |
106 Observer* observer_; // NOT OWNED | 104 Observer* observer_; // NOT OWNED |
107 const char* tracing_category_; | 105 const char* tracing_category_; |
108 const char* disabled_by_default_tracing_category_; | 106 const char* disabled_by_default_tracing_category_; |
109 | 107 |
110 DISALLOW_COPY_AND_ASSIGN(SchedulerHelper); | 108 DISALLOW_COPY_AND_ASSIGN(SchedulerHelper); |
111 }; | 109 }; |
112 | 110 |
113 } // namespace scheduler | 111 } // namespace scheduler |
114 | 112 |
115 #endif // COMPONENTS_SCHEDULER_CHILD_SCHEDULER_HELPER_H_ | 113 #endif // COMPONENTS_SCHEDULER_CHILD_SCHEDULER_HELPER_H_ |
OLD | NEW |