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

Unified Diff: base/task_scheduler/task.h

Issue 1705253002: TaskScheduler [3/9] Task and Sequence (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@s_1_scheduler_lock
Patch Set: CR from Dana and Gab #40-41 Created 4 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/sequence_unittest.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
new file mode 100644
index 0000000000000000000000000000000000000000..6ac483d524916935e620f054001b07540131bb35
--- /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. Support for tracing and
+// profiling inherited from PendingTask.
+struct BASE_EXPORT Task : public PendingTask {
+ Task(const tracked_objects::Location& posted_from,
+ const Closure& task,
+ const TaskTraits& traits);
+ ~Task();
+
+ // The TaskTraits of this task.
+ const TaskTraits traits;
+
+ // The time at which the task was inserted in its sequence. For an undelayed
+ // task, this happens at post time. For a delayed task, this happens some
+ // time after the task's delay has expired. If the task hasn't been inserted
+ // in a sequence yet, this defaults to a null TimeTicks.
+ TimeTicks sequenced_time;
+};
+
+} // namespace internal
+} // namespace base
+
+#endif // BASE_TASK_SCHEDULER_TASK_H_
« no previous file with comments | « base/task_scheduler/sequence_unittest.cc ('k') | base/task_scheduler/task.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698