Roll src/third_party/WebKit 605a979:06cb9e9 (svn 202556:202558)
[chromium-blink-merge.git] / components / scheduler / child / nestable_task_runner_for_test.cc
blob6193d5ea97072287012c7f7433966371096de364
1 // Copyright 2015 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/nestable_task_runner_for_test.h"
7 #include "base/bind.h"
8 #include "base/bind_helpers.h"
10 namespace scheduler {
12 // static
13 scoped_refptr<NestableTaskRunnerForTest> NestableTaskRunnerForTest::Create(
14 scoped_refptr<base::SingleThreadTaskRunner> task_runner) {
15 return make_scoped_refptr(new NestableTaskRunnerForTest(task_runner));
18 NestableTaskRunnerForTest::NestableTaskRunnerForTest(
19 scoped_refptr<base::SingleThreadTaskRunner> task_runner)
20 : task_runner_(task_runner), is_nested_(false) {
23 NestableTaskRunnerForTest::~NestableTaskRunnerForTest() {
26 bool NestableTaskRunnerForTest::PostDelayedTask(
27 const tracked_objects::Location& from_here,
28 const base::Closure& task,
29 base::TimeDelta delay) {
30 return task_runner_->PostDelayedTask(from_here, task, delay);
33 bool NestableTaskRunnerForTest::PostNonNestableDelayedTask(
34 const tracked_objects::Location& from_here,
35 const base::Closure& task,
36 base::TimeDelta delay) {
37 return task_runner_->PostNonNestableDelayedTask(from_here, task, delay);
40 bool NestableTaskRunnerForTest::RunsTasksOnCurrentThread() const {
41 return task_runner_->RunsTasksOnCurrentThread();
44 bool NestableTaskRunnerForTest::IsNested() const {
45 return false;
48 } // namespace scheduler