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

Side by Side Diff: third_party/WebKit/Source/platform/scheduler/child/scheduler_tqm_delegate_for_test.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_for_test.h" 5 #include "platform/scheduler/child/scheduler_tqm_delegate_for_test.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 23 matching lines...) Expand all
34 scoped_refptr<base::SingleThreadTaskRunner> task_runner) { 34 scoped_refptr<base::SingleThreadTaskRunner> task_runner) {
35 default_task_runner_ = std::move(task_runner); 35 default_task_runner_ = std::move(task_runner);
36 } 36 }
37 37
38 void SchedulerTqmDelegateForTest::RestoreDefaultTaskRunner() { 38 void SchedulerTqmDelegateForTest::RestoreDefaultTaskRunner() {
39 default_task_runner_ = nullptr; 39 default_task_runner_ = nullptr;
40 } 40 }
41 41
42 bool SchedulerTqmDelegateForTest::PostDelayedTask( 42 bool SchedulerTqmDelegateForTest::PostDelayedTask(
43 const tracked_objects::Location& from_here, 43 const tracked_objects::Location& from_here,
44 const base::Closure& task, 44 base::Closure task,
45 base::TimeDelta delay) { 45 base::TimeDelta delay) {
46 return task_runner_->PostDelayedTask(from_here, task, delay); 46 return task_runner_->PostDelayedTask(from_here, std::move(task), delay);
47 } 47 }
48 48
49 bool SchedulerTqmDelegateForTest::PostNonNestableDelayedTask( 49 bool SchedulerTqmDelegateForTest::PostNonNestableDelayedTask(
50 const tracked_objects::Location& from_here, 50 const tracked_objects::Location& from_here,
51 const base::Closure& task, 51 base::Closure task,
52 base::TimeDelta delay) { 52 base::TimeDelta delay) {
53 return task_runner_->PostNonNestableDelayedTask(from_here, task, delay); 53 return task_runner_->PostNonNestableDelayedTask(from_here, std::move(task),
54 delay);
54 } 55 }
55 56
56 bool SchedulerTqmDelegateForTest::RunsTasksOnCurrentThread() const { 57 bool SchedulerTqmDelegateForTest::RunsTasksOnCurrentThread() const {
57 return task_runner_->RunsTasksOnCurrentThread(); 58 return task_runner_->RunsTasksOnCurrentThread();
58 } 59 }
59 60
60 bool SchedulerTqmDelegateForTest::IsNested() const { 61 bool SchedulerTqmDelegateForTest::IsNested() const {
61 return task_runner_->IsNested(); 62 return task_runner_->IsNested();
62 } 63 }
63 64
64 void SchedulerTqmDelegateForTest::AddNestingObserver( 65 void SchedulerTqmDelegateForTest::AddNestingObserver(
65 base::MessageLoop::NestingObserver* observer) {} 66 base::MessageLoop::NestingObserver* observer) {}
66 67
67 void SchedulerTqmDelegateForTest::RemoveNestingObserver( 68 void SchedulerTqmDelegateForTest::RemoveNestingObserver(
68 base::MessageLoop::NestingObserver* observer) {} 69 base::MessageLoop::NestingObserver* observer) {}
69 70
70 base::TimeTicks SchedulerTqmDelegateForTest::NowTicks() { 71 base::TimeTicks SchedulerTqmDelegateForTest::NowTicks() {
71 return task_runner_->NowTicks(); 72 return task_runner_->NowTicks();
72 } 73 }
73 74
74 } // namespace scheduler 75 } // namespace scheduler
75 } // namespace blink 76 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698