Allow only one bookmark to be added for multiple fast starring
[chromium-blink-merge.git] / components / scheduler / child / null_worker_scheduler.cc
blob3f0a7cd09c1048755385ab19e401bf80fd4da144
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 "components/scheduler/child/null_worker_scheduler.h"
7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h"
9 #include "base/thread_task_runner_handle.h"
10 #include "components/scheduler/child/null_idle_task_runner.h"
11 #include "components/scheduler/child/null_task_queue.h"
13 namespace scheduler {
15 NullWorkerScheduler::NullWorkerScheduler()
16 : task_runner_(new NullTaskQueue(base::ThreadTaskRunnerHandle::Get())),
17 idle_task_runner_(new NullIdleTaskRunner()) {}
19 NullWorkerScheduler::~NullWorkerScheduler() {
22 scoped_refptr<TaskQueue> 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 scheduler