Index: cc/raster/task.cc |
diff --git a/cc/raster/task.cc b/cc/raster/task.cc |
index 94e413f46d8cbf6df6d1631aaca7e3ab51d9a381..94486fd523a41812647ec939fcf0c0d6e27c7f78 100644 |
--- a/cc/raster/task.cc |
+++ b/cc/raster/task.cc |
@@ -18,6 +18,10 @@ TaskState::~TaskState() { |
"CANCELED state."; |
} |
+bool TaskState::IsNew() const { |
+ return value_ == Value::NEW; |
+} |
+ |
bool TaskState::IsScheduled() const { |
return value_ == Value::SCHEDULED; |
} |
@@ -38,6 +42,23 @@ void TaskState::Reset() { |
value_ = Value::NEW; |
} |
+std::string TaskState::ToString() const { |
+ switch (value_) { |
+ case Value::NEW: |
+ return "NEW"; |
+ case Value::SCHEDULED: |
+ return "SCHEDULED"; |
+ case Value::RUNNING: |
+ return "RUNNING"; |
+ case Value::FINISHED: |
+ return "FINISHED"; |
+ case Value::CANCELED: |
+ return "CANCELED"; |
+ } |
+ NOTREACHED(); |
+ return ""; |
+} |
+ |
void TaskState::DidSchedule() { |
DCHECK(value_ == Value::NEW) |
<< "Task should be in NEW state to get scheduled."; |