OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "platform/scheduler/child/scheduler_tqm_delegate_impl.h" | 5 #include "platform/scheduler/child/scheduler_tqm_delegate_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 namespace blink { | 9 namespace blink { |
10 namespace scheduler { | 10 namespace scheduler { |
(...skipping 22 matching lines...) Expand all Loading... |
33 message_loop_->SetTaskRunner(task_runner); | 33 message_loop_->SetTaskRunner(task_runner); |
34 } | 34 } |
35 | 35 |
36 void SchedulerTqmDelegateImpl::RestoreDefaultTaskRunner() { | 36 void SchedulerTqmDelegateImpl::RestoreDefaultTaskRunner() { |
37 if (base::MessageLoop::current() == message_loop_) | 37 if (base::MessageLoop::current() == message_loop_) |
38 message_loop_->SetTaskRunner(message_loop_task_runner_); | 38 message_loop_->SetTaskRunner(message_loop_task_runner_); |
39 } | 39 } |
40 | 40 |
41 bool SchedulerTqmDelegateImpl::PostDelayedTask( | 41 bool SchedulerTqmDelegateImpl::PostDelayedTask( |
42 const tracked_objects::Location& from_here, | 42 const tracked_objects::Location& from_here, |
43 base::Closure task, | 43 base::OnceClosure task, |
44 base::TimeDelta delay) { | 44 base::TimeDelta delay) { |
45 return message_loop_task_runner_->PostDelayedTask(from_here, std::move(task), | 45 return message_loop_task_runner_->PostDelayedTask(from_here, std::move(task), |
46 delay); | 46 delay); |
47 } | 47 } |
48 | 48 |
49 bool SchedulerTqmDelegateImpl::PostNonNestableDelayedTask( | 49 bool SchedulerTqmDelegateImpl::PostNonNestableDelayedTask( |
50 const tracked_objects::Location& from_here, | 50 const tracked_objects::Location& from_here, |
51 base::Closure task, | 51 base::OnceClosure task, |
52 base::TimeDelta delay) { | 52 base::TimeDelta delay) { |
53 return message_loop_task_runner_->PostNonNestableDelayedTask( | 53 return message_loop_task_runner_->PostNonNestableDelayedTask( |
54 from_here, std::move(task), delay); | 54 from_here, std::move(task), delay); |
55 } | 55 } |
56 | 56 |
57 bool SchedulerTqmDelegateImpl::RunsTasksOnCurrentThread() const { | 57 bool SchedulerTqmDelegateImpl::RunsTasksOnCurrentThread() const { |
58 return message_loop_task_runner_->RunsTasksOnCurrentThread(); | 58 return message_loop_task_runner_->RunsTasksOnCurrentThread(); |
59 } | 59 } |
60 | 60 |
61 bool SchedulerTqmDelegateImpl::IsNested() const { | 61 bool SchedulerTqmDelegateImpl::IsNested() const { |
62 return message_loop_->IsNested(); | 62 return message_loop_->IsNested(); |
63 } | 63 } |
64 | 64 |
65 void SchedulerTqmDelegateImpl::AddNestingObserver( | 65 void SchedulerTqmDelegateImpl::AddNestingObserver( |
66 base::MessageLoop::NestingObserver* observer) { | 66 base::MessageLoop::NestingObserver* observer) { |
67 message_loop_->AddNestingObserver(observer); | 67 message_loop_->AddNestingObserver(observer); |
68 } | 68 } |
69 | 69 |
70 void SchedulerTqmDelegateImpl::RemoveNestingObserver( | 70 void SchedulerTqmDelegateImpl::RemoveNestingObserver( |
71 base::MessageLoop::NestingObserver* observer) { | 71 base::MessageLoop::NestingObserver* observer) { |
72 message_loop_->RemoveNestingObserver(observer); | 72 message_loop_->RemoveNestingObserver(observer); |
73 } | 73 } |
74 | 74 |
75 base::TimeTicks SchedulerTqmDelegateImpl::NowTicks() { | 75 base::TimeTicks SchedulerTqmDelegateImpl::NowTicks() { |
76 return time_source_->NowTicks(); | 76 return time_source_->NowTicks(); |
77 } | 77 } |
78 | 78 |
79 } // namespace scheduler | 79 } // namespace scheduler |
80 } // namespace blink | 80 } // namespace blink |
OLD | NEW |