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

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
« no previous file with comments | « cc/raster/raster_buffer_provider_unittest.cc ('k') | cc/raster/task.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/raster/task.h
diff --git a/cc/raster/task.h b/cc/raster/task.h
index 54bcf8b6b1a508b9d31e50fa39e0a327f144513c..ba8daef10c64a9fee4e68d0c607fae6059c6e139 100644
--- a/cc/raster/task.h
+++ b/cc/raster/task.h
@@ -15,11 +15,27 @@
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
+// This class provides states to manage life cycle of a task and given below is
+// how it is used by TaskGraphWorkQueue to process life cycle of a task.
+// Task is in NEW state when it is created. When task is added to
+// |ready_to_run_tasks| then its state is changed to SCHEDULED. Task can be
+// canceled from NEW state (not yet scheduled to run) or from SCHEDULED state,
+// when new ScheduleTasks() is triggered and its state is changed to CANCELED.
+// When task is about to run it is added |running_tasks| and its state is
+// changed to RUNNING. Once task finishes running, its state is changed to
+// FINISHED. Both CANCELED and FINISHED tasks are added to |completed_tasks|.
+// ╔═════╗
+// +------║ NEW ║------+
+// | ╚═════╝ |
+// v v
+// ┌───────────┐ ╔══════════╗
+// │ SCHEDULED │------> ║ CANCELED ║
+// └───────────┘ ╚══════════╝
+// |
+// v
+// ┌─────────┐ ╔══════════╗
+// │ RUNNING │-------> ║ FINISHED ║
+// └─────────┘ ╚══════════╝
class CC_EXPORT TaskState {
public:
bool IsScheduled() const;
« no previous file with comments | « cc/raster/raster_buffer_provider_unittest.cc ('k') | cc/raster/task.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698