summaryrefslogtreecommitdiff
path: root/base/post_task_and_reply_with_result_internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'base/post_task_and_reply_with_result_internal.h')
-rw-r--r--base/post_task_and_reply_with_result_internal.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/base/post_task_and_reply_with_result_internal.h b/base/post_task_and_reply_with_result_internal.h
index 1456129324..6f50de8b86 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