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

Unified Diff: ios/web/public/web_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/public/browser/browser_thread.h ('k') | ios/web/web_thread_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/public/web_thread.h
diff --git a/ios/web/public/web_thread.h b/ios/web/public/web_thread.h
index 56cbb213d7a03e1d52883e40b1f44395e4be0abd..b5234461cdc419e9ad7ddc28986cda0c820b460b 100644
--- a/ios/web/public/web_thread.h
+++ b/ios/web/public/web_thread.h
@@ -6,8 +6,9 @@
#define IOS_WEB_PUBLIC_WEB_THREAD_H_
#include <string>
+#include <utility>
-#include "base/callback_forward.h"
+#include "base/callback.h"
#include "base/compiler_specific.h"
#include "base/location.h"
#include "base/logging.h"
@@ -116,19 +117,19 @@ class WebThread {
static bool PostTaskAndReply(ID identifier,
const tracked_objects::Location& from_here,
- const base::Closure& task,
- const base::Closure& reply);
+ 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>
@@ -163,8 +164,8 @@ class WebThread {
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/public/browser/browser_thread.h ('k') | ios/web/web_thread_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698