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

Unified Diff: chrome/browser/sync_file_system/sync_task_manager.h

Issue 23513021: Make SyncTaskManager's regular Task cancellable (like SyncTask) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 | « no previous file | chrome/browser/sync_file_system/sync_task_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync_file_system/sync_task_manager.h
diff --git a/chrome/browser/sync_file_system/sync_task_manager.h b/chrome/browser/sync_file_system/sync_task_manager.h
index 42ba0ebf7be44010f7ef019a0fbeaf7fc11037eb..8898dd76e1e4a14145a7548a9bd3af9df2e39028 100644
--- a/chrome/browser/sync_file_system/sync_task_manager.h
+++ b/chrome/browser/sync_file_system/sync_task_manager.h
@@ -48,8 +48,6 @@ class SyncTaskManager
// service status. This should not be called more than once.
void Initialize(SyncStatusCode status);
- // Note that the argument of |task|'s parameter owns |callback|.
- // The reference from |callback| to |task| causes circular dependency.
void ScheduleTask(const Task& task,
const SyncStatusCallback& callback);
void ScheduleSyncTask(scoped_ptr<SyncTask> task,
@@ -60,7 +58,6 @@ class SyncTaskManager
void ScheduleSyncTaskIfIdle(scoped_ptr<SyncTask> task);
void NotifyTaskDone(scoped_ptr<TaskToken> token,
- const SyncStatusCallback& callback,
SyncStatusCode status);
private:
@@ -78,6 +75,8 @@ class SyncTaskManager
SyncStatusCode last_operation_status_;
scoped_ptr<SyncTask> running_task_;
std::deque<base::Closure> pending_tasks_;
+ SyncStatusCallback current_callback_;
+
// Absence of |token_| implies a task is running. Incoming tasks should
// wait for the task to finish in |pending_tasks_| if |token_| is null.
« no previous file with comments | « no previous file | chrome/browser/sync_file_system/sync_task_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698