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

Unified Diff: base/task/task_queue_scheduler.h

Issue 637303003: content: Add task queue manager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Strip out everything else than TaskQueueManager. Added tests. Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: base/task/task_queue_scheduler.h
diff --git a/base/task/task_queue_scheduler.h b/base/task/task_queue_scheduler.h
new file mode 100644
index 0000000000000000000000000000000000000000..dc3faddbc4cf9879eb45587a2fdcef850a2ae3d0
--- /dev/null
+++ b/base/task/task_queue_scheduler.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_SCHEDULER_H_
+#define BASE_TASK_TASK_QUEUE_SCHEDULER_H_
+
+#include <vector>
+
+#include "base/base_export.h"
+#include "base/basictypes.h"
+
+namespace base {
+class TaskQueue;
+
+class BASE_EXPORT TaskQueueScheduler {
+ public:
+ virtual ~TaskQueueScheduler() {}
+
+ // Called once to register the work queues to be scheduled. 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 ChooseWorkQueueToService(size_t* out_queue_index) = 0;
+};
+
+} // namespace content
+
+#endif // BASE_TASK_TASK_QUEUE_SCHEDULER_H_
« base/task/task_queue_manager.cc ('K') | « base/task/task_queue_manager_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698