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

Unified Diff: cc/raster/task.cc

Issue 1866043006: cc: Remove ScheduleOnOriginThread() and CompleteOnOriginThread(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed bug 613529 Created 4 years, 7 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
Index: cc/raster/task.cc
diff --git a/cc/raster/task.cc b/cc/raster/task.cc
index 4f26d12ba4495bef070161fd6b48569654755c51..9dc9c59ccbc1a41e0ad9118a4d7a0cfe4bc1e176 100644
--- a/cc/raster/task.cc
+++ b/cc/raster/task.cc
@@ -13,6 +13,8 @@ TaskState::TaskState() : value_(Value::NEW) {}
TaskState::~TaskState() {
DCHECK(value_ != Value::RUNNING)
<< "Running task should never get destroyed.";
+ // TODO(prashant.n): Remove NEW, once all the tests follow the task life
+ // cycle correctly. Few tests still do not take care of task states.
vmpstr 2016/05/21 00:02:14 I'd prefer that we fix the tests instead of adding
prashant.n 2016/05/21 00:33:53 Few testcases I've fixed in https://codereview.chr
DCHECK(value_ == Value::NEW || value_ == Value::FINISHED ||
value_ == Value::CANCELED)
<< "Task, if scheduled, should get concluded either in FINISHED or "
@@ -26,9 +28,11 @@ bool TaskState::IsScheduled() const {
bool TaskState::IsRunning() const {
return value_ == Value::RUNNING;
}
+
bool TaskState::IsFinished() const {
return value_ == Value::FINISHED;
}
+
bool TaskState::IsCanceled() const {
return value_ == Value::CANCELED;
}
@@ -58,7 +62,7 @@ void TaskState::DidFinish() {
void TaskState::DidCancel() {
DCHECK(value_ == Value::NEW || value_ == Value::SCHEDULED)
- << "Task should be scheduled and not running to get canceled.";
+ << "Task should be either new or scheduled to get canceled.";
value_ = Value::CANCELED;
}

Powered by Google App Engine
This is Rietveld 408576698