blob: fe20847ad63669639c6dc4dae7892bf6eba4abf9 [file] [log] [blame]
// 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.
#include <vector>
#include "base/basictypes.h"
namespace base {
class TaskQueue;
namespace debug {
class TracedValue;
} // namespace debug
} // namespace base
namespace content {
class TaskQueueSelector {
virtual ~TaskQueueSelector() {}
// Called once to register the work queues to be selected from. This function
// is called on the main thread.
virtual void RegisterWorkQueues(
const std::vector<const base::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 SelectWorkQueueToService(size_t* out_queue_index) = 0;
// Serialize the selector state for tracing.
virtual void AsValueInto(base::debug::TracedValue* state) const = 0;
} // namespace content