Index: base/threading/worker_pool_posix.cc |
diff --git a/base/threading/worker_pool_posix.cc b/base/threading/worker_pool_posix.cc |
index b0a2b87157a8c38add6bf5bec37236a5d53ab16e..cc06224bf1bb4a849ff78639dccd4b26f5880364 100644 |
--- a/base/threading/worker_pool_posix.cc |
+++ b/base/threading/worker_pool_posix.cc |
@@ -36,7 +36,7 @@ class WorkerPoolImpl { |
~WorkerPoolImpl(); |
void PostTask(const tracked_objects::Location& from_here, |
- const base::Closure& task, |
+ OnceClosure task, |
bool task_is_slow); |
private: |
@@ -52,9 +52,9 @@ WorkerPoolImpl::~WorkerPoolImpl() { |
} |
void WorkerPoolImpl::PostTask(const tracked_objects::Location& from_here, |
- const base::Closure& task, |
+ OnceClosure task, |
bool task_is_slow) { |
- pool_->PostTask(from_here, task); |
+ pool_->PostTask(from_here, std::move(task)); |
} |
base::LazyInstance<WorkerPoolImpl> g_lazy_worker_pool = |
@@ -90,7 +90,7 @@ void WorkerThread::ThreadMain() { |
tracked_objects::TaskStopwatch stopwatch; |
stopwatch.Start(); |
- pending_task.task.Run(); |
+ std::move(pending_task.task).Run(); |
stopwatch.Stop(); |
tracked_objects::ThreadData::TallyRunOnWorkerThreadIfTracking( |
@@ -105,9 +105,10 @@ void WorkerThread::ThreadMain() { |
// static |
bool WorkerPool::PostTask(const tracked_objects::Location& from_here, |
- const base::Closure& task, |
+ OnceClosure task, |
bool task_is_slow) { |
- g_lazy_worker_pool.Pointer()->PostTask(from_here, task, task_is_slow); |
+ g_lazy_worker_pool.Pointer()->PostTask(from_here, std::move(task), |
+ task_is_slow); |
return true; |
} |
@@ -140,8 +141,8 @@ void PosixDynamicThreadPool::Terminate() { |
void PosixDynamicThreadPool::PostTask( |
const tracked_objects::Location& from_here, |
- const base::Closure& task) { |
- PendingTask pending_task(from_here, task); |
+ OnceClosure task) { |
+ PendingTask pending_task(from_here, std::move(task)); |
AddTask(&pending_task); |
} |