| Index: base/threading/worker_pool_posix.cc
|
| diff --git a/base/threading/worker_pool_posix.cc b/base/threading/worker_pool_posix.cc
|
| index 947914c4b6ae5bfeeb0ccd991fd96ea1d03672e9..e0efa463f75dcbbaa0ccf20dfc6be5c0ab73f6fe 100644
|
| --- a/base/threading/worker_pool_posix.cc
|
| +++ b/base/threading/worker_pool_posix.cc
|
| @@ -6,6 +6,8 @@
|
|
|
| #include <stddef.h>
|
|
|
| +#include <utility>
|
| +
|
| #include "base/bind.h"
|
| #include "base/callback.h"
|
| #include "base/lazy_instance.h"
|
| @@ -47,7 +49,7 @@ class WorkerPoolImpl {
|
| ~WorkerPoolImpl() = delete;
|
|
|
| void PostTask(const tracked_objects::Location& from_here,
|
| - const base::Closure& task,
|
| + base::Closure task,
|
| bool task_is_slow);
|
|
|
| private:
|
| @@ -59,9 +61,9 @@ WorkerPoolImpl::WorkerPoolImpl()
|
| kIdleSecondsBeforeExit)) {}
|
|
|
| void WorkerPoolImpl::PostTask(const tracked_objects::Location& from_here,
|
| - const base::Closure& task,
|
| + base::Closure task,
|
| bool task_is_slow) {
|
| - pool_->PostTask(from_here, task);
|
| + pool_->PostTask(from_here, std::move(task));
|
| }
|
|
|
| base::LazyInstance<WorkerPoolImpl>::Leaky g_lazy_worker_pool =
|
| @@ -112,9 +114,10 @@ void WorkerThread::ThreadMain() {
|
|
|
| // static
|
| bool WorkerPool::PostTask(const tracked_objects::Location& from_here,
|
| - const base::Closure& task,
|
| + base::Closure 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;
|
| }
|
|
|
| @@ -137,8 +140,8 @@ PosixDynamicThreadPool::~PosixDynamicThreadPool() {
|
|
|
| void PosixDynamicThreadPool::PostTask(
|
| const tracked_objects::Location& from_here,
|
| - const base::Closure& task) {
|
| - PendingTask pending_task(from_here, task);
|
| + base::Closure task) {
|
| + PendingTask pending_task(from_here, std::move(task));
|
| AddTask(&pending_task);
|
| }
|
|
|
|
|