Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2973)

Unified Diff: base/threading/post_task_and_reply_impl.cc

Issue 2791243002: Rewrite base::Bind into base::BindOnce on trivial cases in base (Closed)
Patch Set: rebase Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/test/thread_test_helper.cc ('k') | base/threading/post_task_and_reply_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 cddb8981adfdbe406978efd7253388d2e675e8ed..1aaa1e7dda6f06a76b8b1171cce205e3a42d403a 100644
--- a/base/threading/post_task_and_reply_impl.cc
+++ b/base/threading/post_task_and_reply_impl.cc
@@ -44,8 +44,8 @@ class PostTaskAndReplyRelay {
void RunTaskAndPostReply() {
std::move(task_).Run();
origin_task_runner_->PostTask(
- from_here_, Bind(&PostTaskAndReplyRelay::RunReplyAndSelfDestruct,
- base::Unretained(this)));
+ from_here_, BindOnce(&PostTaskAndReplyRelay::RunReplyAndSelfDestruct,
+ base::Unretained(this)));
}
private:
@@ -88,8 +88,8 @@ bool PostTaskAndReplyImpl::PostTaskAndReply(
// to avoid having to suppress every callsite which happens to flakily trigger
// this race.
ANNOTATE_LEAKING_OBJECT_PTR(relay);
- if (!PostTask(from_here, Bind(&PostTaskAndReplyRelay::RunTaskAndPostReply,
- Unretained(relay)))) {
+ if (!PostTask(from_here, BindOnce(&PostTaskAndReplyRelay::RunTaskAndPostReply,
+ Unretained(relay)))) {
delete relay;
return false;
}
« no previous file with comments | « base/test/thread_test_helper.cc ('k') | base/threading/post_task_and_reply_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698