Index: base/task/task_queue_selector.h |
diff --git a/base/task/task_queue_selector.h b/base/task/task_queue_selector.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c3f563092d7dd845572bd1d9524216bd79673895 |
--- /dev/null |
+++ b/base/task/task_queue_selector.h |
@@ -0,0 +1,35 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef BASE_TASK_TASK_QUEUE_SELECTOR_H_ |
+#define BASE_TASK_TASK_QUEUE_SELECTOR_H_ |
+ |
+#include <vector> |
+ |
+#include "base/base_export.h" |
+#include "base/basictypes.h" |
+ |
+namespace base { |
+class TaskQueue; |
+ |
+class BASE_EXPORT TaskQueueSelector { |
+ public: |
+ virtual ~TaskQueueSelector() {} |
+ |
+ // Called once to register the work queues to be selected from. This function |
+ // is called on the main thread. |
+ virtual void RegisterWorkQueues( |
+ const std::vector<const TaskQueue*>& work_queues) = 0; |
+ |
+ // Called to choose the work queue from which the next task should be taken |
+ // and run. Return true if |out_queue| indicates the queue to service or |
+ // false to avoid running any task. |
+ // |
+ // This function is called on the main thread. |
+ virtual bool SelectWorkQueueToService(size_t* out_queue_index) = 0; |
+}; |
+ |
+} // namespace content |
+ |
+#endif // BASE_TASK_TASK_QUEUE_SELECTOR_H_ |