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 802de8c3c736932223b0bcf078faeb123b780e72..cddb8981adfdbe406978efd7253388d2e675e8ed 100644 |
--- a/base/threading/post_task_and_reply_impl.cc |
+++ b/base/threading/post_task_and_reply_impl.cc |
@@ -29,8 +29,8 @@ namespace { |
class PostTaskAndReplyRelay { |
public: |
PostTaskAndReplyRelay(const tracked_objects::Location& from_here, |
- Closure task, |
- Closure reply) |
+ OnceClosure task, |
+ OnceClosure reply) |
: sequence_checker_(), |
from_here_(from_here), |
origin_task_runner_(SequencedTaskRunnerHandle::Get()), |
@@ -42,8 +42,7 @@ class PostTaskAndReplyRelay { |
} |
void RunTaskAndPostReply() { |
- task_.Run(); |
- task_.Reset(); |
+ std::move(task_).Run(); |
origin_task_runner_->PostTask( |
from_here_, Bind(&PostTaskAndReplyRelay::RunReplyAndSelfDestruct, |
base::Unretained(this))); |
@@ -58,7 +57,7 @@ class PostTaskAndReplyRelay { |
// while |reply_| is executing. |
DCHECK(!task_); |
- reply_.Run(); |
+ std::move(reply_).Run(); |
// Cue mission impossible theme. |
delete this; |
@@ -67,8 +66,8 @@ class PostTaskAndReplyRelay { |
const SequenceChecker sequence_checker_; |
const tracked_objects::Location from_here_; |
const scoped_refptr<SequencedTaskRunner> origin_task_runner_; |
- Closure reply_; |
- Closure task_; |
+ OnceClosure reply_; |
+ OnceClosure task_; |
}; |
} // namespace |
@@ -77,8 +76,8 @@ namespace internal { |
bool PostTaskAndReplyImpl::PostTaskAndReply( |
const tracked_objects::Location& from_here, |
- Closure task, |
- Closure reply) { |
+ OnceClosure task, |
+ OnceClosure reply) { |
DCHECK(!task.is_null()) << from_here.ToString(); |
DCHECK(!reply.is_null()) << from_here.ToString(); |
PostTaskAndReplyRelay* relay = |