Chromium Code Reviews| Index: base/threading/post_task_and_reply_impl.cc |
| diff --git a/base/threading/post_task_and_reply_impl.cc b/base/threading/post_task_and_reply_impl.cc |
| index 7899f65f94bd792e3f9bd2f277a9e11595e590b7..913fbfce8003ce632dfd5d9d6277b0fc444ca5f6 100644 |
| --- a/base/threading/post_task_and_reply_impl.cc |
| +++ b/base/threading/post_task_and_reply_impl.cc |
| @@ -5,7 +5,6 @@ |
| #include "base/threading/post_task_and_reply_impl.h" |
| #include "base/bind.h" |
| -#include "base/callback.h" |
| #include "base/debug/leak_annotations.h" |
| #include "base/logging.h" |
| #include "base/memory/ref_counted.h" |
| @@ -28,13 +27,13 @@ namespace { |
| class PostTaskAndReplyRelay { |
| public: |
| PostTaskAndReplyRelay(const tracked_objects::Location& from_here, |
| - const Closure& task, |
| - const Closure& reply) |
| + Closure task, |
| + Closure reply) |
| : sequence_checker_(), |
| from_here_(from_here), |
| origin_task_runner_(SequencedTaskRunnerHandle::Get()), |
| - reply_(reply), |
| - task_(task) {} |
| + reply_(std::move(reply)), |
| + task_(std::move(task)) {} |
|
gab
2017/02/07 15:46:08
#include <utility>
tzik
2017/02/08 01:39:32
Done.
|
| ~PostTaskAndReplyRelay() { |
| DCHECK(sequence_checker_.CalledOnValidSequence()); |
| @@ -77,12 +76,12 @@ namespace internal { |
| bool PostTaskAndReplyImpl::PostTaskAndReply( |
| const tracked_objects::Location& from_here, |
| - const Closure& task, |
| - const Closure& reply) { |
| + Closure task, |
| + Closure reply) { |
| DCHECK(!task.is_null()) << from_here.ToString(); |
| DCHECK(!reply.is_null()) << from_here.ToString(); |
| PostTaskAndReplyRelay* relay = |
| - new PostTaskAndReplyRelay(from_here, task, reply); |
| + new PostTaskAndReplyRelay(from_here, std::move(task), std::move(reply)); |
| // PostTaskAndReplyRelay self-destructs after executing |reply|. On the flip |
| // side though, it is intentionally leaked if the |task| doesn't complete |
| // before the origin sequence stops executing tasks. Annotate |relay| as leaky |