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

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

Issue 2258713003: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 3 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/sequence_unittest.cc ('k') | base/task_scheduler/task_tracker_unittest.cc » ('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 23 matching lines...) Expand all
34 DCHECK(join_for_testing_returned_.IsSet()); 34 DCHECK(join_for_testing_returned_.IsSet());
35 #endif 35 #endif
36 } 36 }
37 37
38 void TaskSchedulerImpl::PostTaskWithTraits( 38 void TaskSchedulerImpl::PostTaskWithTraits(
39 const tracked_objects::Location& from_here, 39 const tracked_objects::Location& from_here,
40 const TaskTraits& traits, 40 const TaskTraits& traits,
41 const Closure& task) { 41 const Closure& task) {
42 // Post |task| as part of a one-off single-task Sequence. 42 // Post |task| as part of a one-off single-task Sequence.
43 GetWorkerPoolForTraits(traits)->PostTaskWithSequence( 43 GetWorkerPoolForTraits(traits)->PostTaskWithSequence(
44 WrapUnique(new Task(from_here, task, traits, TimeDelta())), 44 MakeUnique<Task>(from_here, task, traits, TimeDelta()),
45 make_scoped_refptr(new Sequence), nullptr); 45 make_scoped_refptr(new Sequence), nullptr);
46 } 46 }
47 47
48 scoped_refptr<TaskRunner> TaskSchedulerImpl::CreateTaskRunnerWithTraits( 48 scoped_refptr<TaskRunner> TaskSchedulerImpl::CreateTaskRunnerWithTraits(
49 const TaskTraits& traits, 49 const TaskTraits& traits,
50 ExecutionMode execution_mode) { 50 ExecutionMode execution_mode) {
51 return GetWorkerPoolForTraits(traits)->CreateTaskRunnerWithTraits( 51 return GetWorkerPoolForTraits(traits)->CreateTaskRunnerWithTraits(
52 traits, execution_mode); 52 traits, execution_mode);
53 } 53 }
54 54
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 GetWorkerPoolForTraits(traits)->ReEnqueueSequence(std::move(sequence), 124 GetWorkerPoolForTraits(traits)->ReEnqueueSequence(std::move(sequence),
125 sort_key); 125 sort_key);
126 } 126 }
127 127
128 void TaskSchedulerImpl::OnDelayedRunTimeUpdated() { 128 void TaskSchedulerImpl::OnDelayedRunTimeUpdated() {
129 service_thread_->WakeUp(); 129 service_thread_->WakeUp();
130 } 130 }
131 131
132 } // namespace internal 132 } // namespace internal
133 } // namespace base 133 } // namespace base
OLDNEW
« no previous file with comments | « base/task_scheduler/sequence_unittest.cc ('k') | base/task_scheduler/task_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698