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

Side by Side Diff: third_party/WebKit/Source/platform/scheduler/child/scheduler_tqm_delegate_impl.cc

Issue 2726523002: Pass Callback to TaskRunner by value and consume it on invocation (1) (Closed)
Patch Set: erase Closure* Created 3 years, 8 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
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
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 const base::Closure& task, 43 base::Closure task,
44 base::TimeDelta delay) { 44 base::TimeDelta delay) {
45 return message_loop_task_runner_->PostDelayedTask(from_here, task, delay); 45 return message_loop_task_runner_->PostDelayedTask(from_here, std::move(task),
46 delay);
46 } 47 }
47 48
48 bool SchedulerTqmDelegateImpl::PostNonNestableDelayedTask( 49 bool SchedulerTqmDelegateImpl::PostNonNestableDelayedTask(
49 const tracked_objects::Location& from_here, 50 const tracked_objects::Location& from_here,
50 const base::Closure& task, 51 base::Closure task,
51 base::TimeDelta delay) { 52 base::TimeDelta delay) {
52 return message_loop_task_runner_->PostNonNestableDelayedTask(from_here, task, 53 return message_loop_task_runner_->PostNonNestableDelayedTask(
53 delay); 54 from_here, std::move(task), delay);
54 } 55 }
55 56
56 bool SchedulerTqmDelegateImpl::RunsTasksOnCurrentThread() const { 57 bool SchedulerTqmDelegateImpl::RunsTasksOnCurrentThread() const {
57 return message_loop_task_runner_->RunsTasksOnCurrentThread(); 58 return message_loop_task_runner_->RunsTasksOnCurrentThread();
58 } 59 }
59 60
60 bool SchedulerTqmDelegateImpl::IsNested() const { 61 bool SchedulerTqmDelegateImpl::IsNested() const {
61 return message_loop_->IsNested(); 62 return message_loop_->IsNested();
62 } 63 }
63 64
64 void SchedulerTqmDelegateImpl::AddNestingObserver( 65 void SchedulerTqmDelegateImpl::AddNestingObserver(
65 base::MessageLoop::NestingObserver* observer) { 66 base::MessageLoop::NestingObserver* observer) {
66 message_loop_->AddNestingObserver(observer); 67 message_loop_->AddNestingObserver(observer);
67 } 68 }
68 69
69 void SchedulerTqmDelegateImpl::RemoveNestingObserver( 70 void SchedulerTqmDelegateImpl::RemoveNestingObserver(
70 base::MessageLoop::NestingObserver* observer) { 71 base::MessageLoop::NestingObserver* observer) {
71 message_loop_->RemoveNestingObserver(observer); 72 message_loop_->RemoveNestingObserver(observer);
72 } 73 }
73 74
74 base::TimeTicks SchedulerTqmDelegateImpl::NowTicks() { 75 base::TimeTicks SchedulerTqmDelegateImpl::NowTicks() {
75 return time_source_->NowTicks(); 76 return time_source_->NowTicks();
76 } 77 }
77 78
78 } // namespace scheduler 79 } // namespace scheduler
79 } // namespace blink 80 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698