Add a new SequencedSocketData class.
[chromium-blink-merge.git] / content / child / scheduler / null_worker_scheduler.cc
blob3127c3f13370af5a36d02f1ff8a0da23e350d8e0
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"
7 #include "base/bind.h"
8 #include "base/message_loop/message_loop_proxy.h"
9 #include "content/child/scheduler/null_idle_task_runner.h"
11 namespace content {
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() {
23 return task_runner_;
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 {
42 return false;
45 bool NullWorkerScheduler::ShouldYieldForHighPriorityWork() {
46 return false;
49 void NullWorkerScheduler::Init() {
52 void NullWorkerScheduler::Shutdown() {
55 } // namespace content