Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Side by Side Diff: components/scheduler/child/scheduler_tqm_delegate_for_test.cc

Issue 2118903002: scheduler: Move the Blink scheduler into Blink (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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.
4
5 #include "components/scheduler/child/scheduler_tqm_delegate_for_test.h"
6
7 #include <utility>
8
9 #include "base/bind.h"
10 #include "base/bind_helpers.h"
11 #include "components/scheduler/base/task_queue_manager_delegate_for_test.h"
12
13 namespace scheduler {
14
15 // static
16 scoped_refptr<SchedulerTqmDelegateForTest> SchedulerTqmDelegateForTest::Create(
17 scoped_refptr<base::SingleThreadTaskRunner> task_runner,
18 std::unique_ptr<base::TickClock> time_source) {
19 return make_scoped_refptr(
20 new SchedulerTqmDelegateForTest(task_runner, std::move(time_source)));
21 }
22
23 SchedulerTqmDelegateForTest::SchedulerTqmDelegateForTest(
24 scoped_refptr<base::SingleThreadTaskRunner> task_runner,
25 std::unique_ptr<base::TickClock> time_source)
26 : task_runner_(
27 TaskQueueManagerDelegateForTest::Create(task_runner,
28 std::move(time_source))) {}
29
30 SchedulerTqmDelegateForTest::~SchedulerTqmDelegateForTest() {}
31
32 void SchedulerTqmDelegateForTest::SetDefaultTaskRunner(
33 scoped_refptr<base::SingleThreadTaskRunner> task_runner) {
34 default_task_runner_ = std::move(task_runner);
35 }
36
37 void SchedulerTqmDelegateForTest::RestoreDefaultTaskRunner() {
38 default_task_runner_ = nullptr;
39 }
40
41 bool SchedulerTqmDelegateForTest::PostDelayedTask(
42 const tracked_objects::Location& from_here,
43 const base::Closure& task,
44 base::TimeDelta delay) {
45 return task_runner_->PostDelayedTask(from_here, task, delay);
46 }
47
48 bool SchedulerTqmDelegateForTest::PostNonNestableDelayedTask(
49 const tracked_objects::Location& from_here,
50 const base::Closure& task,
51 base::TimeDelta delay) {
52 return task_runner_->PostNonNestableDelayedTask(from_here, task, delay);
53 }
54
55 bool SchedulerTqmDelegateForTest::RunsTasksOnCurrentThread() const {
56 return task_runner_->RunsTasksOnCurrentThread();
57 }
58
59 bool SchedulerTqmDelegateForTest::IsNested() const {
60 return task_runner_->IsNested();
61 }
62
63 base::TimeTicks SchedulerTqmDelegateForTest::NowTicks() {
64 return task_runner_->NowTicks();
65 }
66
67 } // namespace scheduler
OLDNEW
« no previous file with comments | « components/scheduler/child/scheduler_tqm_delegate_for_test.h ('k') | components/scheduler/child/scheduler_tqm_delegate_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698