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

Unified Diff: cc/raster/task.h

Issue 1866043006: cc: Remove ScheduleOnOriginThread() and CompleteOnOriginThread(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits 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.h
diff --git a/cc/raster/task.h b/cc/raster/task.h
index 54bcf8b6b1a508b9d31e50fa39e0a327f144513c..6d2b6b85434254dd517aff9eab5a4eb5a53e0b5e 100644
--- a/cc/raster/task.h
+++ b/cc/raster/task.h
@@ -16,16 +16,19 @@ namespace cc {
class Task;
// States to manage life cycle of a task. Task gets created with NEW state and
-// concludes either in FINISHED or CANCELLED state. So possible life cycle
-// paths for task are -
-// NEW -> SCHEDULED -> RUNNING -> FINISHED
-// NEW -> SCHEDULED -> CANCELED
+// if scheduled concludes in COMPLETED state. So possible life cycle paths for
vmpstr 2016/05/18 19:08:33 you say here "if scheduled concludes in completed"
prashant.n 2016/05/19 00:59:52 This above path is for task which is not scheduled
+// task are -
+// NEW
vmpstr 2016/05/18 19:08:33 I don't think you need this one?
prashant.n 2016/05/19 00:59:52 We will omit this.
+// NEW -> CANCELED -> COMPLETED
+// NEW -> SCHEDULED -> CANCELED-> COMPLETED
+// NEW -> SCHEDULED -> RUNNING -> FINISHED -> COMPLETED
class CC_EXPORT TaskState {
public:
bool IsScheduled() const;
bool IsRunning() const;
bool IsFinished() const;
bool IsCanceled() const;
+ bool IsCompleted() const;
// Functions to change the state of task. These functions should be called
// only from TaskGraphWorkQueue where the life cycle of a task is decided or
@@ -37,6 +40,10 @@ class CC_EXPORT TaskState {
void DidFinish();
void DidCancel();
+ // Task owner should call this function to indicate that this task is
+ // completed and no more it should be processed.
vmpstr 2016/05/18 19:08:33 s/no more it should be processed/it doesn't need t
prashant.n 2016/05/19 00:59:52 Ok, I'll modify this.
+ void DidComplete();
+
private:
friend class Task;
@@ -44,7 +51,14 @@ class CC_EXPORT TaskState {
TaskState();
~TaskState();
- enum class Value : uint16_t { NEW, SCHEDULED, RUNNING, FINISHED, CANCELED };
+ enum class Value : uint16_t {
+ NEW,
+ SCHEDULED,
+ RUNNING,
+ FINISHED,
+ CANCELED,
+ COMPLETED
vmpstr 2016/05/18 19:08:33 In my mind the difference between "FINISHED" and "
prashant.n 2016/05/19 00:59:52 Yes. Finished and Completed are 2 sides of same co
+ };
Value value_;
};

Powered by Google App Engine
This is Rietveld 408576698