OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef BASE_TASK_TASK_QUEUE_SELECTOR_H_ |
| 6 #define BASE_TASK_TASK_QUEUE_SELECTOR_H_ |
| 7 |
| 8 #include <vector> |
| 9 |
| 10 #include "base/base_export.h" |
| 11 #include "base/basictypes.h" |
| 12 |
| 13 namespace base { |
| 14 class TaskQueue; |
| 15 |
| 16 class BASE_EXPORT TaskQueueSelector { |
| 17 public: |
| 18 virtual ~TaskQueueSelector() {} |
| 19 |
| 20 // Called once to register the work queues to be selected from. This function |
| 21 // is called on the main thread. |
| 22 virtual void RegisterWorkQueues( |
| 23 const std::vector<const TaskQueue*>& work_queues) = 0; |
| 24 |
| 25 // Called to choose the work queue from which the next task should be taken |
| 26 // and run. Return true if |out_queue| indicates the queue to service or |
| 27 // false to avoid running any task. |
| 28 // |
| 29 // This function is called on the main thread. |
| 30 virtual bool SelectWorkQueueToService(size_t* out_queue_index) = 0; |
| 31 }; |
| 32 |
| 33 } // namespace content |
| 34 |
| 35 #endif // BASE_TASK_TASK_QUEUE_SELECTOR_H_ |
OLD | NEW |