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

Unified Diff: cc/raster/task.cc

Issue 2537683002: cc: Add image decode queue functionality to image manager. (Closed)
Patch Set: test fix Created 3 years, 11 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 | « cc/raster/task.h ('k') | cc/test/fake_layer_tree_host_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.";
« no previous file with comments | « cc/raster/task.h ('k') | cc/test/fake_layer_tree_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698