Add an UMA stat to be able to see if the User pods are show on start screen,
[chromium-blink-merge.git] / content / child / scheduler / task_queue_selector.h
blob7e85fe2d45c94f632f3a3a61f34ade63750012d0
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.
5 #ifndef CONTENT_CHILD_SCHEDULER_TASK_QUEUE_SELECTOR_H_
6 #define CONTENT_CHILD_SCHEDULER_TASK_QUEUE_SELECTOR_H_
8 #include <vector>
10 #include "base/basictypes.h"
12 namespace base {
13 class TaskQueue;
14 namespace trace_event {
15 class TracedValue;
16 } // namespace trace_event
17 } // namespace base
19 namespace content {
21 class TaskQueueSelector {
22 public:
23 virtual ~TaskQueueSelector() {}
25 // Called once to register the work queues to be selected from. This function
26 // is called on the main thread.
27 virtual void RegisterWorkQueues(
28 const std::vector<const base::TaskQueue*>& work_queues) = 0;
30 // Called to choose the work queue from which the next task should be taken
31 // and run. Return true if |out_queue| indicates the queue to service or
32 // false to avoid running any task.
34 // This function is called on the main thread.
35 virtual bool SelectWorkQueueToService(size_t* out_queue_index) = 0;
37 // Serialize the selector state for tracing.
38 virtual void AsValueInto(base::trace_event::TracedValue* state) const = 0;
41 } // namespace content
43 #endif // CONTENT_CHILD_SCHEDULER_TASK_QUEUE_SELECTOR_H_