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

Unified Diff: content/renderer/scheduler/task_queue_scheduler.h

Issue 637303003: content: Add task queue manager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: First stab at blink integration. 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: 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_

Powered by Google App Engine
This is Rietveld 408576698