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

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

Issue 1424053002: Adds a flag to support "Virtual Time" to the blink scheduler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 5 years, 1 month 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 "base/bind.h"
8 #include "base/bind_helpers.h"
9 #include "components/scheduler/base/task_queue_manager_delegate_for_test.h"
10
11 namespace scheduler {
12
13 // static
14 scoped_refptr<SchedulerTqmDelegateForTest> SchedulerTqmDelegateForTest::Create(
15 scoped_refptr<base::SingleThreadTaskRunner> task_runner,
16 scoped_ptr<base::TickClock> time_source) {
17 return make_scoped_refptr(
18 new SchedulerTqmDelegateForTest(task_runner, time_source.Pass()));
19 }
20
21 SchedulerTqmDelegateForTest::SchedulerTqmDelegateForTest(
22 scoped_refptr<base::SingleThreadTaskRunner> task_runner,
23 scoped_ptr<base::TickClock> time_source)
24 : task_runner_(
25 TaskQueueManagerDelegateForTest::Create(task_runner,
26 time_source.Pass())) {}
27
28 SchedulerTqmDelegateForTest::~SchedulerTqmDelegateForTest() {}
29
30 void SchedulerTqmDelegateForTest::SetDefaultTaskRunner(
31 scoped_refptr<base::SingleThreadTaskRunner> task_runner) {
32 default_task_runner_ = task_runner.Pass();
33 }
34
35 void SchedulerTqmDelegateForTest::RestoreDefaultTaskRunner() {
36 default_task_runner_ = nullptr;
37 }
38
39 bool SchedulerTqmDelegateForTest::PostDelayedTask(
40 const tracked_objects::Location& from_here,
41 const base::Closure& task,
42 base::TimeDelta delay) {
43 return task_runner_->PostDelayedTask(from_here, task, delay);
44 }
45
46 bool SchedulerTqmDelegateForTest::PostNonNestableDelayedTask(
47 const tracked_objects::Location& from_here,
48 const base::Closure& task,
49 base::TimeDelta delay) {
50 return task_runner_->PostNonNestableDelayedTask(from_here, task, delay);
51 }
52
53 bool SchedulerTqmDelegateForTest::RunsTasksOnCurrentThread() const {
54 return task_runner_->RunsTasksOnCurrentThread();
55 }
56
57 bool SchedulerTqmDelegateForTest::IsNested() const {
58 return task_runner_->IsNested();
59 }
60
61 base::TimeTicks SchedulerTqmDelegateForTest::NowTicks() {
62 return task_runner_->NowTicks();
63 }
64
65 void SchedulerTqmDelegateForTest::OnNoMoreImmediateWork() {}
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