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 #include "content/child/scheduler/null_worker_scheduler.h"
8 #include "base/message_loop/message_loop_proxy.h"
9 #include "content/child/scheduler/null_idle_task_runner.h"
13 NullWorkerScheduler::NullWorkerScheduler()
14 : task_runner_(base::MessageLoopProxy::current()),
15 idle_task_runner_(new NullIdleTaskRunner()) {
18 NullWorkerScheduler::~NullWorkerScheduler() {
21 scoped_refptr
<base::SingleThreadTaskRunner
>
22 NullWorkerScheduler::DefaultTaskRunner() {
26 scoped_refptr
<SingleThreadIdleTaskRunner
>
27 NullWorkerScheduler::IdleTaskRunner() {
28 return idle_task_runner_
;
31 void NullWorkerScheduler::AddTaskObserver(
32 base::MessageLoop::TaskObserver
* task_observer
) {
33 base::MessageLoop::current()->AddTaskObserver(task_observer
);
36 void NullWorkerScheduler::RemoveTaskObserver(
37 base::MessageLoop::TaskObserver
* task_observer
) {
38 base::MessageLoop::current()->RemoveTaskObserver(task_observer
);
41 bool NullWorkerScheduler::CanExceedIdleDeadlineIfRequired() const {
45 bool NullWorkerScheduler::ShouldYieldForHighPriorityWork() {
49 void NullWorkerScheduler::Init() {
52 void NullWorkerScheduler::Shutdown() {
55 } // namespace content