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

Side by Side 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 unified diff | Download patch
OLDNEW
(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 CONTENT_RENDERER_SCHEDULER_TASK_QUEUE_SCHEDULER_H_
6 #define CONTENT_RENDERER_SCHEDULER_TASK_QUEUE_SCHEDULER_H_
7
8 #include "content/renderer/scheduler/task_queue_manager.h"
9
10 namespace content {
11
12 class TaskQueueScheduler {
13 public:
14 virtual ~TaskQueueScheduler() {}
15
16 // Called once to register the work queues to be scheduled. This function is
17 // called on the main thread.
18 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
19 const std::vector<const base::TaskQueue*>& work_queues) = 0;
20
21 // A new task was placed in the incoming task queue |queue|. This function is
22 // called on the posting thread.
23 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.
24
25 // Called to confirm that the given work queue |queue| should be reloaded as
26 // it has become empty. Return true to allow the work queue to be reloaded or
27 // false to keep the work queue empty.
28 //
29 // This function is called on the main thread.
30 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.
31
32 // Called to choose the work queue from which the next task should be taken
33 // and run. Return true if |out_queue| indicates the queue to service or
34 // false to avoid running any tasks.
35 //
36 // This function is called on the main thread.
37 virtual bool ChooseWorkQueueToService(
38 TaskQueueManager::QueueId* out_queue) = 0;
39 };
40
41 } // namespace content
42
43 #endif // CONTENT_RENDERER_SCHEDULER_TASK_QUEUE_SCHEDULER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698