Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef BASE_TASK_SCHEDULER_TASK_H_ | |
| 6 #define BASE_TASK_SCHEDULER_TASK_H_ | |
| 7 | |
| 8 #include "base/base_export.h" | |
| 9 #include "base/callback_forward.h" | |
| 10 #include "base/location.h" | |
| 11 #include "base/pending_task.h" | |
| 12 #include "base/task_scheduler/task_traits.h" | |
| 13 #include "base/time/time.h" | |
| 14 | |
| 15 namespace base { | |
| 16 namespace internal { | |
| 17 | |
| 18 // A task is a unit of work inside the task scheduler. | |
|
gab
2016/02/18 03:00:46
Add to the comment that support for tracing is inh
fdoray
2016/02/18 14:56:13
Done.
| |
| 19 struct BASE_EXPORT Task : public PendingTask { | |
| 20 Task(); | |
| 21 Task(const tracked_objects::Location& posted_from, | |
| 22 const Closure& task, | |
| 23 const TaskTraits& traits, | |
| 24 const TimeTicks& post_time); | |
|
gab
2016/02/18 03:00:46
Comments on constructor to highlight differences.
fdoray
2016/02/18 14:56:13
Default constructor is not needed.
| |
| 25 ~Task(); | |
| 26 | |
| 27 // The traits describing where, when and how the task should run. | |
|
gab
2016/02/18 03:00:46
// The TaskTraits of this task.
(what those are i
fdoray
2016/02/18 14:56:13
Done.
| |
| 28 TaskTraits traits; | |
| 29 | |
| 30 // The time at which the task was posted. For a delayed task, this is the time | |
| 31 // at which the task was inserted in its sequence after its delay expired; not | |
| 32 // the time at which it was initially sent to a task scheduler. | |
| 33 TimeTicks post_time; | |
|
fdoray
2016/02/18 01:46:11
Is this clearer?
// The time at which the task wa
gab
2016/02/18 03:00:46
Actually, for a delayed task isn't this the time a
fdoray
2016/02/18 14:56:13
Done. There's no need to add |scheduled_time| to t
gab
2016/02/18 20:22:34
Right, sorry for making this comment so long and c
| |
| 34 }; | |
| 35 | |
| 36 } // namespace internal | |
| 37 } // namespace base | |
| 38 | |
| 39 #endif // BASE_TASK_SCHEDULER_TASK_H_ | |
| OLD | NEW |