Index: base/threading/worker_pool.cc |
diff --git a/base/threading/worker_pool.cc b/base/threading/worker_pool.cc |
index d47037d79a057201009db9b890557c0400a76715..bc313ce25ba210673db951e56ca007d55c417086 100644 |
--- a/base/threading/worker_pool.cc |
+++ b/base/threading/worker_pool.cc |
@@ -27,8 +27,8 @@ class PostTaskAndReplyWorkerPool : public internal::PostTaskAndReplyImpl { |
private: |
bool PostTask(const tracked_objects::Location& from_here, |
- const Closure& task) override { |
- return WorkerPool::PostTask(from_here, task, task_is_slow_); |
+ Closure task) override { |
+ return WorkerPool::PostTask(from_here, std::move(task), task_is_slow_); |
} |
bool task_is_slow_; |
@@ -45,7 +45,7 @@ class WorkerPoolTaskRunner : public TaskRunner { |
// TaskRunner implementation |
bool PostDelayedTask(const tracked_objects::Location& from_here, |
- const Closure& task, |
+ Closure task, |
TimeDelta delay) override; |
bool RunsTasksOnCurrentThread() const override; |
@@ -56,7 +56,7 @@ class WorkerPoolTaskRunner : public TaskRunner { |
// zero because non-zero delays are not supported. |
bool PostDelayedTaskAssertZeroDelay( |
const tracked_objects::Location& from_here, |
- const Closure& task, |
+ Closure task, |
base::TimeDelta delay); |
const bool tasks_are_slow_; |
@@ -73,9 +73,9 @@ WorkerPoolTaskRunner::~WorkerPoolTaskRunner() { |
bool WorkerPoolTaskRunner::PostDelayedTask( |
const tracked_objects::Location& from_here, |
- const Closure& task, |
+ Closure task, |
TimeDelta delay) { |
- return PostDelayedTaskAssertZeroDelay(from_here, task, delay); |
+ return PostDelayedTaskAssertZeroDelay(from_here, std::move(task), delay); |
} |
bool WorkerPoolTaskRunner::RunsTasksOnCurrentThread() const { |
@@ -84,11 +84,11 @@ bool WorkerPoolTaskRunner::RunsTasksOnCurrentThread() const { |
bool WorkerPoolTaskRunner::PostDelayedTaskAssertZeroDelay( |
const tracked_objects::Location& from_here, |
- const Closure& task, |
+ Closure task, |
base::TimeDelta delay) { |
DCHECK_EQ(delay.InMillisecondsRoundedUp(), 0) |
<< "WorkerPoolTaskRunner does not support non-zero delays"; |
- return WorkerPool::PostTask(from_here, task, tasks_are_slow_); |
+ return WorkerPool::PostTask(from_here, std::move(task), tasks_are_slow_); |
} |
struct TaskRunnerHolder { |