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_BASE_TASK_QUEUE_H_ | 5 #ifndef COMPONENTS_SCHEDULER_BASE_TASK_QUEUE_H_ |
6 #define COMPONENTS_SCHEDULER_BASE_TASK_QUEUE_H_ | 6 #define COMPONENTS_SCHEDULER_BASE_TASK_QUEUE_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 // manager executes its tasks on. | 181 // manager executes its tasks on. |
182 virtual void AddTaskObserver( | 182 virtual void AddTaskObserver( |
183 base::MessageLoop::TaskObserver* task_observer) = 0; | 183 base::MessageLoop::TaskObserver* task_observer) = 0; |
184 virtual void RemoveTaskObserver( | 184 virtual void RemoveTaskObserver( |
185 base::MessageLoop::TaskObserver* task_observer) = 0; | 185 base::MessageLoop::TaskObserver* task_observer) = 0; |
186 | 186 |
187 // Removes the task queue from the previous TimeDomain and adds it to | 187 // Removes the task queue from the previous TimeDomain and adds it to |
188 // |domain|. This is a moderately expensive operation. | 188 // |domain|. This is a moderately expensive operation. |
189 virtual void SetTimeDomain(TimeDomain* domain) = 0; | 189 virtual void SetTimeDomain(TimeDomain* domain) = 0; |
190 | 190 |
| 191 // Returns the queue's current TimeDomain. Can be called from any thread. |
| 192 virtual TimeDomain* GetTimeDomain() const = 0; |
| 193 |
191 protected: | 194 protected: |
192 ~TaskQueue() override {} | 195 ~TaskQueue() override {} |
193 | 196 |
194 DISALLOW_COPY_AND_ASSIGN(TaskQueue); | 197 DISALLOW_COPY_AND_ASSIGN(TaskQueue); |
195 }; | 198 }; |
196 | 199 |
197 } // namespace scheduler | 200 } // namespace scheduler |
198 | 201 |
199 #endif // COMPONENTS_SCHEDULER_BASE_TASK_QUEUE_H_ | 202 #endif // COMPONENTS_SCHEDULER_BASE_TASK_QUEUE_H_ |
OLD | NEW |