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

Unified Diff: base/task_runner.cc

Issue 2678303002: Pass Callback by value on PostTaskAndReply family (Closed)
Patch Set: #include Created 3 years, 10 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
Index: base/task_runner.cc
diff --git a/base/task_runner.cc b/base/task_runner.cc
index 262e1f8b09eac8d9f91b4113ddeccc27a33323ad..86b78c5751e6e8a083da82791a7139d93099a36c 100644
--- a/base/task_runner.cc
+++ b/base/task_runner.cc
@@ -45,12 +45,11 @@ bool TaskRunner::PostTask(const tracked_objects::Location& from_here,
return PostDelayedTask(from_here, task, base::TimeDelta());
}
-bool TaskRunner::PostTaskAndReply(
- const tracked_objects::Location& from_here,
- const Closure& task,
- const Closure& reply) {
+bool TaskRunner::PostTaskAndReply(const tracked_objects::Location& from_here,
+ Closure task,
+ Closure reply) {
return PostTaskAndReplyTaskRunner(this).PostTaskAndReply(
- from_here, task, reply);
+ from_here, std::move(task), std::move(reply));
gab 2017/02/07 15:46:08 #include <utility> for std::move
tzik 2017/02/08 01:39:32 Done.
}
TaskRunner::TaskRunner() {}
« no previous file with comments | « base/task_runner.h ('k') | base/task_runner_util.h » ('j') | base/task_runner_util.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698