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

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

Issue 11299008: Remote service state handling (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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
Index: chrome/browser/sync_file_system/drive_file_sync_service.h
diff --git a/chrome/browser/sync_file_system/drive_file_sync_service.h b/chrome/browser/sync_file_system/drive_file_sync_service.h
index 897ceeffb7f54a820b46b0d4ae37947cb4794cd5..a3fcf7519f6a7e26d30284bba7aa646e9ae5dd59 100644
--- a/chrome/browser/sync_file_system/drive_file_sync_service.h
+++ b/chrome/browser/sync_file_system/drive_file_sync_service.h
@@ -108,12 +108,30 @@ class DriveFileSyncService
typedef std::map<FilePath, int64> PathToChangeStamp;
typedef std::map<GURL, PathToChangeStamp> ChangeStampMap;
+ // Task types; used for task token handling.
+ enum TaskType {
+ // No task is holding this token.
+ TASK_TYPE_NONE,
+
+ // Token is granted for drive-related async task.
+ TASK_TYPE_DRIVE,
+
+ // Token is granted for async database task.
+ TASK_TYPE_DATABASE,
+ };
+
DriveFileSyncService(scoped_ptr<DriveFileSyncClient> sync_client,
scoped_ptr<DriveMetadataStore> metadata_store);
- scoped_ptr<TaskToken> GetToken(const tracked_objects::Location& from_here);
+ // This should be called when an async task needs to get a task token.
+ // |task_description| is optional but should give human-readable
+ // messages that describe the task that is acquiring the token.
+ scoped_ptr<TaskToken> GetToken(const tracked_objects::Location& from_here,
+ TaskType task_type,
+ const std::string& task_description);
void NotifyTaskDone(fileapi::SyncStatusCode status,
scoped_ptr<TaskToken> token);
+ void UpdateServiceState();
void DidInitializeMetadataStore(scoped_ptr<TaskToken> token,
fileapi::SyncStatusCode status,
@@ -156,7 +174,8 @@ class DriveFileSyncService
scoped_ptr<DriveMetadataStore> metadata_store_;
scoped_ptr<DriveFileSyncClient> sync_client_;
- fileapi::SyncStatusCode status_;
+ fileapi::SyncStatusCode last_operation_status_;
+ RemoteServiceState state_;
std::deque<base::Closure> pending_tasks_;
int64 largest_changestamp_;

Powered by Google App Engine
This is Rietveld 408576698