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

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: rebased 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
« no previous file with comments | « no previous file | chrome/browser/sync_file_system/drive_file_sync_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 a1943dc7f24f5476af5ee0093e4403ba1b13f1be..63b12267fa926f6e98dfe9bc2bdb3e2f78723897 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,
@@ -151,7 +169,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_;
« no previous file with comments | « no previous file | chrome/browser/sync_file_system/drive_file_sync_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698