OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |