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

Unified Diff: base/post_task_and_reply_with_result_internal.h

Issue 2637843002: Migrate base::TaskRunner from Closure to OnceClosure (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/message_loop/message_loop_task_runner.cc ('k') | base/sequenced_task_runner.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/post_task_and_reply_with_result_internal.h
diff --git a/base/post_task_and_reply_with_result_internal.h b/base/post_task_and_reply_with_result_internal.h
index 1456129324a55dd80b90124895c110bde5d735d5..6f50de8b8609fc0163df914f0229b8dceaa0e3f5 100644
--- a/base/post_task_and_reply_with_result_internal.h
+++ b/base/post_task_and_reply_with_result_internal.h
@@ -16,16 +16,15 @@ namespace internal {
// Adapts a function that produces a result via a return value to
// one that returns via an output parameter.
template <typename ReturnType>
-void ReturnAsParamAdapter(const Callback<ReturnType(void)>& func,
- ReturnType* result) {
- *result = func.Run();
+void ReturnAsParamAdapter(OnceCallback<ReturnType()> func, ReturnType* result) {
+ *result = std::move(func).Run();
}
// Adapts a T* result to a callblack that expects a T.
template <typename TaskReturnType, typename ReplyArgType>
-void ReplyAdapter(const Callback<void(ReplyArgType)>& callback,
+void ReplyAdapter(OnceCallback<void(ReplyArgType)> callback,
TaskReturnType* result) {
- callback.Run(std::move(*result));
+ std::move(callback).Run(std::move(*result));
}
} // namespace internal
« no previous file with comments | « base/message_loop/message_loop_task_runner.cc ('k') | base/sequenced_task_runner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698