| 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.
|
|
|