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

Unified Diff: base/task_scheduler/scheduler_thread_pool_impl.cc

Issue 2076153002: [TaskScheduler] Support TaskRunnerHandles from parallel tasks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mix_c_Ab
Patch Set: Created 4 years, 6 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/task_scheduler/scheduler_thread_pool.h ('k') | base/task_scheduler/task.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/task_scheduler/scheduler_thread_pool_impl.cc
diff --git a/base/task_scheduler/scheduler_thread_pool_impl.cc b/base/task_scheduler/scheduler_thread_pool_impl.cc
index 44667e99d23cb9e189f55b1819bfb859a315d295..9863e8497f9e5e7be842ffe8fc5e3602a6473cf4 100644
--- a/base/task_scheduler/scheduler_thread_pool_impl.cc
+++ b/base/task_scheduler/scheduler_thread_pool_impl.cc
@@ -49,10 +49,12 @@ class SchedulerParallelTaskRunner : public TaskRunner {
bool PostDelayedTask(const tracked_objects::Location& from_here,
const Closure& closure,
TimeDelta delay) override {
+ std::unique_ptr<Task> task(new Task(from_here, closure, traits_, delay));
+ task->task_runner_ref = this;
+
// Post the task as part of a one-off single-task Sequence.
return thread_pool_->PostTaskWithSequence(
- WrapUnique(new Task(from_here, closure, traits_, delay)),
- make_scoped_refptr(new Sequence), nullptr);
+ std::move(task), make_scoped_refptr(new Sequence), nullptr);
}
bool RunsTasksOnCurrentThread() const override {
« no previous file with comments | « base/task_scheduler/scheduler_thread_pool.h ('k') | base/task_scheduler/task.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698