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

Side by Side Diff: base/task_scheduler/task_scheduler_impl.cc

Issue 2637843002: Migrate base::TaskRunner from Closure to OnceClosure (Closed)
Patch Set: rebase 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
« no previous file with comments | « base/task_scheduler/task_scheduler_impl.h ('k') | base/test/null_task_runner.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "base/task_scheduler/task_scheduler_impl.h" 5 #include "base/task_scheduler/task_scheduler_impl.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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 115
116 TaskSchedulerImpl::~TaskSchedulerImpl() { 116 TaskSchedulerImpl::~TaskSchedulerImpl() {
117 #if DCHECK_IS_ON() 117 #if DCHECK_IS_ON()
118 DCHECK(join_for_testing_returned_.IsSet()); 118 DCHECK(join_for_testing_returned_.IsSet());
119 #endif 119 #endif
120 } 120 }
121 121
122 void TaskSchedulerImpl::PostDelayedTaskWithTraits( 122 void TaskSchedulerImpl::PostDelayedTaskWithTraits(
123 const tracked_objects::Location& from_here, 123 const tracked_objects::Location& from_here,
124 const TaskTraits& traits, 124 const TaskTraits& traits,
125 Closure task, 125 OnceClosure task,
126 TimeDelta delay) { 126 TimeDelta delay) {
127 // Post |task| as part of a one-off single-task Sequence. 127 // Post |task| as part of a one-off single-task Sequence.
128 GetWorkerPoolForTraits(traits)->PostTaskWithSequence( 128 GetWorkerPoolForTraits(traits)->PostTaskWithSequence(
129 MakeUnique<Task>(from_here, std::move(task), traits, delay), 129 MakeUnique<Task>(from_here, std::move(task), traits, delay),
130 make_scoped_refptr(new Sequence)); 130 make_scoped_refptr(new Sequence));
131 } 131 }
132 132
133 scoped_refptr<TaskRunner> TaskSchedulerImpl::CreateTaskRunnerWithTraits( 133 scoped_refptr<TaskRunner> TaskSchedulerImpl::CreateTaskRunnerWithTraits(
134 const TaskTraits& traits) { 134 const TaskTraits& traits) {
135 return GetWorkerPoolForTraits(traits)->CreateTaskRunnerWithTraits(traits); 135 return GetWorkerPoolForTraits(traits)->CreateTaskRunnerWithTraits(traits);
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 // in |sequence|. 277 // in |sequence|.
278 const TaskTraits traits = 278 const TaskTraits traits =
279 sequence->PeekTaskTraits().WithPriority(sort_key.priority()); 279 sequence->PeekTaskTraits().WithPriority(sort_key.priority());
280 280
281 GetWorkerPoolForTraits(traits)->ReEnqueueSequence(std::move(sequence), 281 GetWorkerPoolForTraits(traits)->ReEnqueueSequence(std::move(sequence),
282 sort_key); 282 sort_key);
283 } 283 }
284 284
285 } // namespace internal 285 } // namespace internal
286 } // namespace base 286 } // namespace base
OLDNEW
« no previous file with comments | « base/task_scheduler/task_scheduler_impl.h ('k') | base/test/null_task_runner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698