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

Unified Diff: base/threading/worker_pool.cc

Issue 2678303002: Pass Callback by value on PostTaskAndReply family (Closed)
Patch Set: rebase 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
« no previous file with comments | « base/threading/worker_pool.h ('k') | content/browser/browser_thread_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/threading/worker_pool.cc
diff --git a/base/threading/worker_pool.cc b/base/threading/worker_pool.cc
index 96a391480831144730e774af305739dd81449053..9d2b3bafce9885694a9edc1fea2b9e9489ddbe6c 100644
--- a/base/threading/worker_pool.cc
+++ b/base/threading/worker_pool.cc
@@ -4,6 +4,8 @@
#include "base/threading/worker_pool.h"
+#include <utility>
+
#include "base/bind.h"
#include "base/compiler_specific.h"
#include "base/debug/leak_annotations.h"
@@ -100,8 +102,8 @@ struct TaskRunnerHolder {
} // namespace
bool WorkerPool::PostTaskAndReply(const tracked_objects::Location& from_here,
- const Closure& task,
- const Closure& reply,
+ Closure task,
+ Closure reply,
bool task_is_slow) {
// Do not report PostTaskAndReplyRelay leaks in tests. There's nothing we can
// do about them because WorkerPool doesn't have a flushing API.
@@ -109,8 +111,8 @@ bool WorkerPool::PostTaskAndReply(const tracked_objects::Location& from_here,
// http://crbug.com/290897
// Note: this annotation does not cover tasks posted through a TaskRunner.
ANNOTATE_SCOPED_MEMORY_LEAK;
- return PostTaskAndReplyWorkerPool(task_is_slow).PostTaskAndReply(
- from_here, task, reply);
+ return PostTaskAndReplyWorkerPool(task_is_slow)
+ .PostTaskAndReply(from_here, std::move(task), std::move(reply));
}
// static
« no previous file with comments | « base/threading/worker_pool.h ('k') | content/browser/browser_thread_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698