Index: content/renderer/scheduler/task_queue_scheduler.h |
diff --git a/content/renderer/scheduler/task_queue_scheduler.h b/content/renderer/scheduler/task_queue_scheduler.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2480e76d2b19c0dce337e7daee598c545986c8b8 |
--- /dev/null |
+++ b/content/renderer/scheduler/task_queue_scheduler.h |
@@ -0,0 +1,43 @@ |
+// 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 CONTENT_RENDERER_SCHEDULER_TASK_QUEUE_SCHEDULER_H_ |
+#define CONTENT_RENDERER_SCHEDULER_TASK_QUEUE_SCHEDULER_H_ |
+ |
+#include "content/renderer/scheduler/task_queue_manager.h" |
+ |
+namespace content { |
+ |
+class TaskQueueScheduler { |
+ public: |
+ virtual ~TaskQueueScheduler() {} |
+ |
+ // Called once to register the work queues to be scheduled. This function is |
+ // called on the main thread. |
+ virtual void SetWorkQueues( |
alexclarke
2014/10/13 10:06:23
We need a way for the scheduler to query the seque
Sami
2014/10/13 18:16:21
Looks like we can get away with just exposing the
|
+ const std::vector<const base::TaskQueue*>& work_queues) = 0; |
+ |
+ // A new task was placed in the incoming task queue |queue|. This function is |
+ // called on the posting thread. |
+ virtual void DidQueueTask(TaskQueueManager::QueueId queue) = 0; |
alexclarke
2014/10/13 10:06:23
Could we get a function to turn these notification
Sami
2014/10/13 18:16:21
Notifications are gone now.
|
+ |
+ // Called to confirm that the given work queue |queue| should be reloaded as |
+ // it has become empty. Return true to allow the work queue to be reloaded or |
+ // false to keep the work queue empty. |
+ // |
+ // This function is called on the main thread. |
+ virtual bool ShouldReloadWorkQueue(TaskQueueManager::QueueId queue) = 0; |
alexclarke
2014/10/13 10:06:23
I'm surprised the scheduler needs to be aware of t
Sami
2014/10/13 18:16:21
Also gone.
|
+ |
+ // 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 tasks. |
+ // |
+ // This function is called on the main thread. |
+ virtual bool ChooseWorkQueueToService( |
+ TaskQueueManager::QueueId* out_queue) = 0; |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_RENDERER_SCHEDULER_TASK_QUEUE_SCHEDULER_H_ |