Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef BASE_TASK_SCHEDULER_TASK_H_ | 5 #ifndef BASE_TASK_SCHEDULER_TASK_H_ |
| 6 #define BASE_TASK_SCHEDULER_TASK_H_ | 6 #define BASE_TASK_SCHEDULER_TASK_H_ |
| 7 | 7 |
| 8 #include "base/base_export.h" | 8 #include "base/base_export.h" |
| 9 #include "base/callback_forward.h" | 9 #include "base/callback_forward.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| 11 #include "base/pending_task.h" | 11 #include "base/pending_task.h" |
| 12 #include "base/task_scheduler/task_traits.h" | 12 #include "base/task_scheduler/task_traits.h" |
| 13 #include "base/time/time.h" | 13 #include "base/time/time.h" |
| 14 | 14 |
| 15 namespace base { | 15 namespace base { |
| 16 namespace internal { | 16 namespace internal { |
| 17 | 17 |
| 18 // A task is a unit of work inside the task scheduler. Support for tracing and | 18 // A task is a unit of work inside the task scheduler. Support for tracing and |
| 19 // profiling inherited from PendingTask. | 19 // profiling inherited from PendingTask. |
| 20 struct BASE_EXPORT Task : public PendingTask { | 20 struct BASE_EXPORT Task : public PendingTask { |
| 21 Task(const tracked_objects::Location& posted_from, | 21 Task(const tracked_objects::Location& posted_from, |
|
gab
2016/04/18 16:20:39
Also, I don't mind forcing the explicit parameter
fdoray
2016/04/18 16:33:44
I prefer forcing |delayed_run_time| because it is
gab
2016/04/18 17:00:13
Good point, hadn't realized all other uses were fo
| |
| 22 const Closure& task, | 22 const Closure& task, |
| 23 const TaskTraits& traits); | 23 const TaskTraits& traits, |
| 24 const TimeTicks& delayed_run_time); | |
|
gab
2016/04/18 16:12:14
Document parameters (in particular is |delayed_run
fdoray
2016/04/18 16:33:44
Done.
| |
| 24 ~Task(); | 25 ~Task(); |
| 25 | 26 |
| 26 // The TaskTraits of this task. | 27 // The TaskTraits of this task. |
| 27 const TaskTraits traits; | 28 const TaskTraits traits; |
| 28 | 29 |
| 29 // The time at which the task was inserted in its sequence. For an undelayed | 30 // The time at which the task was inserted in its sequence. For an undelayed |
| 30 // task, this happens at post time. For a delayed task, this happens some | 31 // task, this happens at post time. For a delayed task, this happens some |
| 31 // time after the task's delay has expired. If the task hasn't been inserted | 32 // time after the task's delay has expired. If the task hasn't been inserted |
| 32 // in a sequence yet, this defaults to a null TimeTicks. | 33 // in a sequence yet, this defaults to a null TimeTicks. |
| 33 TimeTicks sequenced_time; | 34 TimeTicks sequenced_time; |
| 34 }; | 35 }; |
| 35 | 36 |
| 36 } // namespace internal | 37 } // namespace internal |
| 37 } // namespace base | 38 } // namespace base |
| 38 | 39 |
| 39 #endif // BASE_TASK_SCHEDULER_TASK_H_ | 40 #endif // BASE_TASK_SCHEDULER_TASK_H_ |
| OLD | NEW |