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

Unified Diff: chrome/browser/chromeos/drive/sync_client.h

Issue 68543002: drive: Support offline delete (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Stop modifying local state after server side update Created 7 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/chromeos/drive/sync_client.h
diff --git a/chrome/browser/chromeos/drive/sync_client.h b/chrome/browser/chromeos/drive/sync_client.h
index 4582f6ca10772d53bd424281488014608cb10c3b..b390147878571ba5ac19d642652e2b158df5d6b4 100644
--- a/chrome/browser/chromeos/drive/sync_client.h
+++ b/chrome/browser/chromeos/drive/sync_client.h
@@ -34,6 +34,7 @@ class UpdateOperation;
namespace internal {
class FileCache;
+class RemovePerformer;
class ResourceMetadata;
// The SyncClient is used to synchronize pinned files on Drive and the
@@ -71,6 +72,9 @@ class SyncClient {
void AddUploadTask(const ClientContext& context,
const std::string& local_id);
+ // Adds a remove task to the queue.
+ void AddRemoveTask(const std::string& local_id);
+
// Starts processing the backlog (i.e. pinned-but-not-filed files and
// dirty-but-not-uploaded files). Kicks off retrieval of the local
// IDs of these files, and then starts the sync loop.
@@ -104,7 +108,8 @@ class SyncClient {
// Called when the local IDs of files in the backlog are obtained.
void OnGetLocalIdsOfBacklog(const std::vector<std::string>* to_fetch,
- const std::vector<std::string>* to_upload);
+ const std::vector<std::string>* to_upload,
+ const std::vector<std::string>* to_remove);
// Adds fetch tasks.
void AddFetchTasks(const std::vector<std::string>* local_ids);
@@ -120,6 +125,9 @@ class SyncClient {
// Calls DoSyncLoop() to go back to the sync loop.
void OnUploadFileComplete(const std::string& local_id, FileError error);
+ // Called when the entry is removed.
+ void OnRemoveComplete(const std::string& local_id, FileError error);
+
scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_;
ResourceMetadata* metadata_;
FileCache* cache_;
@@ -130,6 +138,9 @@ class SyncClient {
// Used to upload committed files.
scoped_ptr<file_system::UpdateOperation> update_operation_;
+ // Used to remove entries from the trash.
+ scoped_ptr<RemovePerformer> remove_performer_;
+
// List of the local ids of resources which have a fetch task created.
std::set<std::string> fetch_list_;
« no previous file with comments | « chrome/browser/chromeos/drive/sync/remove_performer_unittest.cc ('k') | chrome/browser/chromeos/drive/sync_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698