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

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

Issue 2637843002: Migrate base::TaskRunner from Closure to OnceClosure (Closed)
Patch Set: rebase without dcheck_in_ref_count 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 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 // in |sequence|. 269 // in |sequence|.
270 const TaskTraits traits = 270 const TaskTraits traits =
271 sequence->PeekTaskTraits().WithPriority(sort_key.priority()); 271 sequence->PeekTaskTraits().WithPriority(sort_key.priority());
272 272
273 GetWorkerPoolForTraits(traits)->ReEnqueueSequence(std::move(sequence), 273 GetWorkerPoolForTraits(traits)->ReEnqueueSequence(std::move(sequence),
274 sort_key); 274 sort_key);
275 } 275 }
276 276
277 } // namespace internal 277 } // namespace internal
278 } // namespace base 278 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698