Index: base/task_scheduler/task.h |
diff --git a/base/task_scheduler/task.h b/base/task_scheduler/task.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c0be0c9583050247ffe98bd177d2f4e7bee60161 |
--- /dev/null |
+++ b/base/task_scheduler/task.h |
@@ -0,0 +1,39 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef BASE_TASK_SCHEDULER_TASK_H_ |
+#define BASE_TASK_SCHEDULER_TASK_H_ |
+ |
+#include "base/base_export.h" |
+#include "base/callback_forward.h" |
+#include "base/location.h" |
+#include "base/pending_task.h" |
+#include "base/task_scheduler/task_traits.h" |
+#include "base/time/time.h" |
+ |
+namespace base { |
+namespace internal { |
+ |
+// 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.
|
+struct BASE_EXPORT Task : public PendingTask { |
+ Task(); |
+ Task(const tracked_objects::Location& posted_from, |
+ const Closure& task, |
+ const TaskTraits& traits, |
+ 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.
|
+ ~Task(); |
+ |
+ // 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.
|
+ TaskTraits traits; |
+ |
+ // The time at which the task was posted. For a delayed task, this is the time |
+ // at which the task was inserted in its sequence after its delay expired; not |
+ // the time at which it was initially sent to a task scheduler. |
+ 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
|
+}; |
+ |
+} // namespace internal |
+} // namespace base |
+ |
+#endif // BASE_TASK_SCHEDULER_TASK_H_ |