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

Unified Diff: base/task/cancelable_task_tracker.h

Issue 2657603004: Clear PostTaskAndReply task on the destination thread (3) (Closed)
Patch Set: rebase Created 3 years, 11 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
Index: base/task/cancelable_task_tracker.h
diff --git a/base/task/cancelable_task_tracker.h b/base/task/cancelable_task_tracker.h
index 959c86f9fd67e781f9e2e19341b20c053e31da79..1c8524dfc4f72745e15cb2c86a04f58e2f58c7c5 100644
--- a/base/task/cancelable_task_tracker.h
+++ b/base/task/cancelable_task_tracker.h
@@ -74,25 +74,21 @@ class BASE_EXPORT CancelableTaskTracker {
TaskId PostTaskAndReply(base::TaskRunner* task_runner,
const tracked_objects::Location& from_here,
- const base::Closure& task,
- const base::Closure& reply);
+ base::Closure task,
+ base::Closure reply);
template <typename TaskReturnType, typename ReplyArgType>
- TaskId PostTaskAndReplyWithResult(
- base::TaskRunner* task_runner,
- const tracked_objects::Location& from_here,
- const base::Callback<TaskReturnType(void)>& task,
- const base::Callback<void(ReplyArgType)>& reply) {
+ TaskId PostTaskAndReplyWithResult(base::TaskRunner* task_runner,
+ const tracked_objects::Location& from_here,
+ base::Callback<TaskReturnType()> task,
+ base::Callback<void(ReplyArgType)> reply) {
TaskReturnType* result = new TaskReturnType();
return PostTaskAndReply(
- task_runner,
- from_here,
+ task_runner, from_here,
base::Bind(&base::internal::ReturnAsParamAdapter<TaskReturnType>,
- task,
- base::Unretained(result)),
+ std::move(task), base::Unretained(result)),
base::Bind(&base::internal::ReplyAdapter<TaskReturnType, ReplyArgType>,
- reply,
- base::Owned(result)));
+ std::move(reply), base::Owned(result)));
}
// Creates a tracked TaskId and an associated IsCanceledCallback. Client can

Powered by Google App Engine
This is Rietveld 408576698