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

Unified Diff: content/public/browser/browser_thread.h

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 | « content/browser/browser_thread_impl.cc ('k') | ios/web/public/web_thread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/browser/browser_thread.h
diff --git a/content/public/browser/browser_thread.h b/content/public/browser/browser_thread.h
index e31797af858eacd0a79c10e531631b42f12045a7..1fb3e271a7ee023c3343d3de5c22be349690fe2f 100644
--- a/content/public/browser/browser_thread.h
+++ b/content/public/browser/browser_thread.h
@@ -6,6 +6,7 @@
#define CONTENT_PUBLIC_BROWSER_BROWSER_THREAD_H_
#include <string>
+#include <utility>
#include "base/callback.h"
#include "base/location.h"
@@ -119,22 +120,21 @@ class CONTENT_EXPORT BrowserThread {
const base::Closure& task,
base::TimeDelta delay);
- static bool PostTaskAndReply(
- ID identifier,
- const tracked_objects::Location& from_here,
- const base::Closure& task,
- const base::Closure& reply);
+ static bool PostTaskAndReply(ID identifier,
+ const tracked_objects::Location& from_here,
+ base::Closure task,
+ base::Closure reply);
template <typename ReturnType, typename ReplyArgType>
static bool PostTaskAndReplyWithResult(
ID identifier,
const tracked_objects::Location& from_here,
- const base::Callback<ReturnType(void)>& task,
- const base::Callback<void(ReplyArgType)>& reply) {
+ base::Callback<ReturnType()> task,
+ base::Callback<void(ReplyArgType)> reply) {
scoped_refptr<base::SingleThreadTaskRunner> task_runner =
GetTaskRunnerForThread(identifier);
- return base::PostTaskAndReplyWithResult(task_runner.get(), from_here, task,
- reply);
+ return base::PostTaskAndReplyWithResult(task_runner.get(), from_here,
+ std::move(task), std::move(reply));
}
template <class T>
@@ -176,8 +176,8 @@ class CONTENT_EXPORT BrowserThread {
const base::Closure& task);
static bool PostBlockingPoolTaskAndReply(
const tracked_objects::Location& from_here,
- const base::Closure& task,
- const base::Closure& reply);
+ base::Closure task,
+ base::Closure reply);
static bool PostBlockingPoolSequencedTask(
const std::string& sequence_token_name,
const tracked_objects::Location& from_here,
« no previous file with comments | « content/browser/browser_thread_impl.cc ('k') | ios/web/public/web_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698