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

Unified Diff: base/task_scheduler/task.h

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_impl.cc ('k') | base/task_scheduler/task_scheduler_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/task_scheduler/task.h
diff --git a/base/task_scheduler/task.h b/base/task_scheduler/task.h
index 2b53c690fddffc752ce63ec98b900a0b34f06674..2a448897e3b70fb44aa4e6d2cb9118f18d14cc51 100644
--- a/base/task_scheduler/task.h
+++ b/base/task_scheduler/task.h
@@ -13,6 +13,7 @@
#include "base/pending_task.h"
#include "base/sequenced_task_runner.h"
#include "base/single_thread_task_runner.h"
+#include "base/task_runner.h"
#include "base/task_scheduler/task_traits.h"
#include "base/time/time.h"
@@ -40,15 +41,16 @@ struct BASE_EXPORT Task : public PendingTask {
// in a sequence yet, this defaults to a null TimeTicks.
TimeTicks sequenced_time;
- // A reference to the SequencedTaskRunner or SingleThreadTaskRunner that
- // posted this task, if any. Used to set ThreadTaskRunnerHandle and/or
- // SequencedTaskRunnerHandle while the task is running.
+ // A reference to the TaskRunner that posted this task. Used to set
+ // TaskRunnerHandle's TaskScopes while the task is running. Exactly one of
+ // these should be set per Task.
// Note: this creates an ownership cycle
// Sequence -> Task -> TaskRunner -> Sequence -> ...
// but that's okay as it's broken when the Task is popped from its Sequence
// after being executed which means this cycle forces the TaskRunner to stick
// around until all its tasks have been executed which is a requirement to
// support TaskRunnerHandles.
+ scoped_refptr<TaskRunner> task_runner_ref;
scoped_refptr<SequencedTaskRunner> sequenced_task_runner_ref;
scoped_refptr<SingleThreadTaskRunner> single_thread_task_runner_ref;
« no previous file with comments | « base/task_scheduler/scheduler_thread_pool_impl.cc ('k') | base/task_scheduler/task_scheduler_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698