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

Unified Diff: chrome/browser/sync_file_system/drive_backend/remote_to_local_syncer.h

Issue 59193003: [SyncFS] Add RemoteToLocalSyncer skeleton (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/sync_file_system/drive_backend/remote_to_local_syncer.h
diff --git a/chrome/browser/sync_file_system/drive_backend/remote_to_local_syncer.h b/chrome/browser/sync_file_system/drive_backend/remote_to_local_syncer.h
index 56c65c4036d6850ac1a8a8340d100f3b43b1a0d4..519feef19b89a9fd0ebdb027e74b69fe525fb185 100644
--- a/chrome/browser/sync_file_system/drive_backend/remote_to_local_syncer.h
+++ b/chrome/browser/sync_file_system/drive_backend/remote_to_local_syncer.h
@@ -6,6 +6,7 @@
#define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_REMOTE_TO_LOCAL_SYNCER_H_
#include "base/memory/weak_ptr.h"
+#include "chrome/browser/sync_file_system/drive_backend/metadata_database.pb.h"
#include "chrome/browser/sync_file_system/remote_change_processor.h"
#include "chrome/browser/sync_file_system/sync_callbacks.h"
#include "chrome/browser/sync_file_system/sync_task.h"
@@ -14,6 +15,10 @@ namespace drive {
class DriveServiceInterface;
}
+namespace drive {
+class DriveServiceInterface;
+}
+
namespace sync_file_system {
namespace drive_backend {
@@ -22,17 +27,64 @@ class SyncEngineContext;
class RemoteToLocalSyncer : public SyncTask {
public:
- explicit RemoteToLocalSyncer(SyncEngineContext* sync_context);
+ enum Priority {
+ PRIORITY_NORMAL = 1 << 0,
+ PRIORITY_LOW = 1 << 1,
+ };
+
+ // |priorities| must be a bitwise-or'd value of Priority.
+ // Conflicting trackers will have low priority for RemoteToLocalSyncer so that
+ // it should be resolved by LocatToRemoteSyncer.
+ RemoteToLocalSyncer(SyncEngineContext* sync_context,
+ int priorities);
virtual ~RemoteToLocalSyncer();
virtual void Run(const SyncStatusCallback& callback) OVERRIDE;
private:
+ void AnalyzeCurrentDirtyTracker();
+
+ void ResolveRemoteChange(const SyncStatusCallback& callback);
+
+ void GetRemoteResource(const SyncStatusCallback& callback);
+
+ void HandleDeletion(const SyncStatusCallback& callback);
+ void HandleNewFile(const SyncStatusCallback& callback);
+ void HandleContentUpdate(const SyncStatusCallback& callback);
+ void ListFolderContent(const SyncStatusCallback& callback);
+ void HandleRename(const SyncStatusCallback& callback);
+ void HandleReorganize(const SyncStatusCallback& callback);
+ void HandleOfflineSolvable(const SyncStatusCallback& callback);
+
+ void SyncCompleted(const SyncStatusCallback& callback);
+
+ void Prepare(const SyncStatusCallback& callback);
+ void DidPrepare(const SyncStatusCallback& callback,
+ SyncStatusCode status,
+ const SyncFileMetadata& metadata,
+ const FileChangeList& changes);
+
drive::DriveServiceInterface* drive_service();
MetadataDatabase* metadata_database();
RemoteChangeProcessor* remote_change_processor();
SyncEngineContext* sync_context_; // Not owned.
+ int priorities_;
+ FileTracker dirty_tracker_;
+ FileTracker parent_tracker_;
+ FileMetadata remote_metadata_;
+
+ bool missing_remote_details_;
+ bool missing_synced_details_;
+ bool deleted_remote_details_;
+ bool deleted_synced_details_;
+ bool title_changed_;
+ bool content_changed_;
+ bool needs_folder_listing_;
+ bool missing_parent_;
+
+ bool sync_root_modification_;
+
base::WeakPtrFactory<RemoteToLocalSyncer> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(RemoteToLocalSyncer);

Powered by Google App Engine
This is Rietveld 408576698