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

Unified Diff: base/task_scheduler/task.h

Issue 2762703002: FOR REFERENCE ONLY Task Scheduler COM Task Runner (Closed)
Patch Set: 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
« no previous file with comments | « base/task_scheduler/scheduler_worker.cc ('k') | base/task_scheduler/task.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 c5b9bdb53bdc8b7a51c4a2ed20df403f30fe55d0..fa7f0fd2fae14971f381b2e3f684c1dc4c7d703a 100644
--- a/base/task_scheduler/task.h
+++ b/base/task_scheduler/task.h
@@ -22,6 +22,13 @@ namespace internal {
// A task is a unit of work inside the task scheduler. Support for tracing and
// profiling inherited from PendingTask.
struct BASE_EXPORT Task : public PendingTask {
+ enum class TaskType {
+ // A task provided by an external caller of the task scheduler.
+ NORMAL,
+ // A task created by the task scheduler.
+ INTERNAL,
+ };
+
// |posted_from| is the site the task was posted from. |task| is the closure
// to run. |traits_in| is metadata about the task. |delay| is a delay that
// must expire before the Task runs. If |delay| is non-zero and the shutdown
@@ -30,7 +37,8 @@ struct BASE_EXPORT Task : public PendingTask {
Task(const tracked_objects::Location& posted_from,
const Closure& task,
const TaskTraits& traits,
- TimeDelta delay);
+ TimeDelta delay,
+ TaskType task_type = TaskType::NORMAL);
~Task();
// The TaskTraits of this task.
@@ -45,6 +53,9 @@ struct BASE_EXPORT Task : public PendingTask {
// in a sequence yet, this defaults to a null TimeTicks.
TimeTicks sequenced_time;
+ // The TaskType for this task.
+ const TaskType task_type;
+
// 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.
« no previous file with comments | « base/task_scheduler/scheduler_worker.cc ('k') | base/task_scheduler/task.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698