Index: cc/raster/task.cc |
diff --git a/cc/raster/task.cc b/cc/raster/task.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..d025ef6366757f1c656efe448a4ef1f7910b9bef |
--- /dev/null |
+++ b/cc/raster/task.cc |
@@ -0,0 +1,66 @@ |
+// 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. |
+ |
+#include "cc/raster/task.h" |
+ |
+#include "base/logging.h" |
+ |
+namespace cc { |
+ |
+Task::Task() |
+ : type_(TASK_TYPE_DEFAULT), |
+ will_run_(false), |
+ did_run_(false), |
+ did_complete_(false) {} |
+ |
+Task::Task(Task::Vector* dependencies) |
+ : dependencies_(std::move(*dependencies)), |
+ type_(TASK_TYPE_DEFAULT), |
+ will_run_(false), |
+ did_run_(false), |
+ did_complete_(false) {} |
+ |
+Task::~Task() { |
+ DCHECK(!will_run_); |
+ DCHECK(!did_run_ || did_complete_); |
+} |
+ |
+void Task::WillRun() { |
+ DCHECK(!will_run_); |
+ DCHECK(!did_run_); |
+ will_run_ = true; |
+} |
+ |
+void Task::DidRun() { |
+ DCHECK(will_run_); |
+ will_run_ = false; |
+ did_run_ = true; |
+} |
+ |
+bool Task::HasFinishedRunning() const { |
+ return did_run_; |
+} |
+ |
+void Task::DidComplete() { |
+ DCHECK(!did_complete_); |
+ did_complete_ = true; |
+} |
+ |
+bool Task::HasCompleted() const { |
+ return did_complete_; |
+} |
+ |
+bool Task::SupportsConcurrentExecution() const { |
+ return true; |
+} |
+ |
+TaskType Task::GetTaskType() { |
+ return type_; |
+} |
+ |
+void Task::SetTaskType(TaskType type) { |
+ type_ = type; |
+} |
+ |
+} // namespace cc |