| Index: base/task_scheduler/post_task.cc
|
| diff --git a/base/task_scheduler/post_task.cc b/base/task_scheduler/post_task.cc
|
| index f415cd3800b555a3d34980660a57eb77eef5353a..5594e9963d2585717e31418224bfe7f98744bbec 100644
|
| --- a/base/task_scheduler/post_task.cc
|
| +++ b/base/task_scheduler/post_task.cc
|
| @@ -4,6 +4,7 @@
|
|
|
| #include "base/task_scheduler/post_task.h"
|
|
|
| +#include "base/callback.h"
|
| #include "base/task_scheduler/task_scheduler.h"
|
| #include "base/threading/post_task_and_reply_impl.h"
|
|
|
| @@ -18,8 +19,8 @@ class PostTaskAndReplyTaskRunner : public internal::PostTaskAndReplyImpl {
|
|
|
| private:
|
| bool PostTask(const tracked_objects::Location& from_here,
|
| - const Closure& task) override {
|
| - PostTaskWithTraits(from_here, traits_, task);
|
| + OnceClosure task) override {
|
| + PostTaskWithTraits(from_here, traits_, std::move(task));
|
| return true;
|
| }
|
|
|
| @@ -29,27 +30,30 @@ class PostTaskAndReplyTaskRunner : public internal::PostTaskAndReplyImpl {
|
|
|
| } // namespace
|
|
|
| -void PostTask(const tracked_objects::Location& from_here, const Closure& task) {
|
| - PostTaskWithTraits(from_here, TaskTraits(), task);
|
| +void PostTask(const tracked_objects::Location& from_here, OnceClosure task) {
|
| + PostTaskWithTraits(from_here, TaskTraits(), std::move(task));
|
| }
|
|
|
| void PostTaskAndReply(const tracked_objects::Location& from_here,
|
| - const Closure& task,
|
| - const Closure& reply) {
|
| - PostTaskWithTraitsAndReply(from_here, TaskTraits(), task, reply);
|
| + OnceClosure task,
|
| + OnceClosure reply) {
|
| + PostTaskWithTraitsAndReply(from_here, TaskTraits(),
|
| + std::move(task), std::move(reply));
|
| }
|
|
|
| void PostTaskWithTraits(const tracked_objects::Location& from_here,
|
| TaskTraits traits,
|
| - const Closure& task) {
|
| - TaskScheduler::GetInstance()->PostTaskWithTraits(from_here, traits, task);
|
| + OnceClosure task) {
|
| + TaskScheduler::GetInstance()->PostTaskWithTraits(from_here, traits,
|
| + std::move(task));
|
| }
|
|
|
| void PostTaskWithTraitsAndReply(const tracked_objects::Location& from_here,
|
| TaskTraits traits,
|
| - const Closure& task,
|
| - const Closure& reply) {
|
| - PostTaskAndReplyTaskRunner(traits).PostTaskAndReply(from_here, task, reply);
|
| + OnceClosure task,
|
| + OnceClosure reply) {
|
| + PostTaskAndReplyTaskRunner(traits).PostTaskAndReply(
|
| + from_here, std::move(task), std::move(reply));
|
| }
|
|
|
| scoped_refptr<TaskRunner> CreateTaskRunnerWithTraits(
|
|
|