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

Unified Diff: components/offline_pages/core/task.h

Issue 2535273003: [Offline pages] TaskQueue polishing (Closed)
Patch Set: Created 4 years, 1 month 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 | « no previous file | components/offline_pages/core/task_queue.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/offline_pages/core/task.h
diff --git a/components/offline_pages/core/task.h b/components/offline_pages/core/task.h
index 4d77679ce079cb2ce815f2ef61d01a16952043a4..8c259c33649210c34c488fede6e3d506cbff66bd 100644
--- a/components/offline_pages/core/task.h
+++ b/components/offline_pages/core/task.h
@@ -19,7 +19,9 @@ namespace offline_pages {
// * Derive your new task from offline_pages::Task.
// * Implement your task with as many async operations on the controlled
// resource as is required. (In general the smaller the task the better.)
-// * Whenever the task is terminated, call |Complete|.
+// * Whenever the task is terminated, call |Task::TaskComplete|. This step is
+// mandatory to ensure |TaskQueue| can pick another task. It should be called
+// once, but in every situation when task is exited.
// * To schedule task for execution call |TaskQueue::AddTask|.
//
// If there is a chance that a task callback will come after the task is
@@ -37,8 +39,6 @@ class Task {
// first step of the task should be implemented by overloading this method.
// The task should define an additional method for every asynchronous step,
// with each step setting up the next step as a callback.
- // TODO(fgorski): Consider alternative: protected RunImpl(), so that we can
- // add things like UMA in the Run method.
virtual void Run() = 0;
// Sets the callback normally used by |TaskQueue| for testing. See
« no previous file with comments | « no previous file | components/offline_pages/core/task_queue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698