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

Unified Diff: base/task_scheduler/task_scheduler_impl.cc

Issue 2726523002: Pass Callback to TaskRunner by value and consume it on invocation (1) (Closed)
Patch Set: rebase Created 3 years, 9 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_scheduler/task_scheduler_impl.cc
diff --git a/base/task_scheduler/task_scheduler_impl.cc b/base/task_scheduler/task_scheduler_impl.cc
index 9f4e4b0ef03f82e73819e3078e8a675350c41c43..6488bd9a9406416476e756c9dc52d78e47ab73d1 100644
--- a/base/task_scheduler/task_scheduler_impl.cc
+++ b/base/task_scheduler/task_scheduler_impl.cc
@@ -44,11 +44,11 @@ TaskSchedulerImpl::~TaskSchedulerImpl() {
void TaskSchedulerImpl::PostDelayedTaskWithTraits(
const tracked_objects::Location& from_here,
const TaskTraits& traits,
- const Closure& task,
+ Closure task,
TimeDelta delay) {
// Post |task| as part of a one-off single-task Sequence.
GetWorkerPoolForTraits(traits)->PostTaskWithSequence(
- MakeUnique<Task>(from_here, task, traits, delay),
+ MakeUnique<Task>(from_here, std::move(task), traits, delay),
make_scoped_refptr(new Sequence), nullptr);
}

Powered by Google App Engine
This is Rietveld 408576698