| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_REMOTE_TO_LOCAL_SYNCER_H_ | 5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_REMOTE_TO_LOCAL_SYNCER_H_ |
| 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_REMOTE_TO_LOCAL_SYNCER_H_ | 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_REMOTE_TO_LOCAL_SYNCER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 } | 34 } |
| 35 | 35 |
| 36 namespace sync_file_system { | 36 namespace sync_file_system { |
| 37 namespace drive_backend { | 37 namespace drive_backend { |
| 38 | 38 |
| 39 class MetadataDatabase; | 39 class MetadataDatabase; |
| 40 class SyncEngineContext; | 40 class SyncEngineContext; |
| 41 | 41 |
| 42 class RemoteToLocalSyncer : public SyncTask { | 42 class RemoteToLocalSyncer : public SyncTask { |
| 43 public: | 43 public: |
| 44 enum Priority { | |
| 45 PRIORITY_NORMAL = 1 << 0, | |
| 46 PRIORITY_LOW = 1 << 1, | |
| 47 }; | |
| 48 | |
| 49 // |priorities| must be a bitwise-or'd value of Priority. | |
| 50 // Conflicting trackers will have low priority for RemoteToLocalSyncer so that | 44 // Conflicting trackers will have low priority for RemoteToLocalSyncer so that |
| 51 // it should be resolved by LocatToRemoteSyncer. | 45 // it should be resolved by LocatToRemoteSyncer. |
| 52 RemoteToLocalSyncer(SyncEngineContext* sync_context, | 46 explicit RemoteToLocalSyncer(SyncEngineContext* sync_context); |
| 53 int priorities); | |
| 54 virtual ~RemoteToLocalSyncer(); | 47 virtual ~RemoteToLocalSyncer(); |
| 55 | 48 |
| 56 virtual void Run(const SyncStatusCallback& callback) OVERRIDE; | 49 virtual void Run(const SyncStatusCallback& callback) OVERRIDE; |
| 57 | 50 |
| 58 const fileapi::FileSystemURL& url() const { return url_; } | 51 const fileapi::FileSystemURL& url() const { return url_; } |
| 59 SyncAction sync_action() const { return sync_action_; } | 52 SyncAction sync_action() const { return sync_action_; } |
| 60 | 53 |
| 61 private: | 54 private: |
| 62 typedef std::vector<std::string> FileIDList; | 55 typedef std::vector<std::string> FileIDList; |
| 63 | 56 |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 SyncStatusCode status); | 182 SyncStatusCode status); |
| 190 | 183 |
| 191 void CreateFolder(const SyncStatusCallback& callback); | 184 void CreateFolder(const SyncStatusCallback& callback); |
| 192 | 185 |
| 193 drive::DriveServiceInterface* drive_service(); | 186 drive::DriveServiceInterface* drive_service(); |
| 194 MetadataDatabase* metadata_database(); | 187 MetadataDatabase* metadata_database(); |
| 195 RemoteChangeProcessor* remote_change_processor(); | 188 RemoteChangeProcessor* remote_change_processor(); |
| 196 | 189 |
| 197 SyncEngineContext* sync_context_; // Not owned. | 190 SyncEngineContext* sync_context_; // Not owned. |
| 198 | 191 |
| 199 int priorities_; | |
| 200 scoped_ptr<FileTracker> dirty_tracker_; | 192 scoped_ptr<FileTracker> dirty_tracker_; |
| 201 scoped_ptr<FileMetadata> remote_metadata_; | 193 scoped_ptr<FileMetadata> remote_metadata_; |
| 202 | 194 |
| 203 fileapi::FileSystemURL url_; | 195 fileapi::FileSystemURL url_; |
| 204 SyncAction sync_action_; | 196 SyncAction sync_action_; |
| 205 | 197 |
| 206 scoped_ptr<SyncFileMetadata> local_metadata_; | 198 scoped_ptr<SyncFileMetadata> local_metadata_; |
| 207 scoped_ptr<FileChangeList> local_changes_; | 199 scoped_ptr<FileChangeList> local_changes_; |
| 208 | 200 |
| 209 base::WeakPtrFactory<RemoteToLocalSyncer> weak_ptr_factory_; | 201 base::WeakPtrFactory<RemoteToLocalSyncer> weak_ptr_factory_; |
| 210 | 202 |
| 211 DISALLOW_COPY_AND_ASSIGN(RemoteToLocalSyncer); | 203 DISALLOW_COPY_AND_ASSIGN(RemoteToLocalSyncer); |
| 212 }; | 204 }; |
| 213 | 205 |
| 214 } // namespace drive_backend | 206 } // namespace drive_backend |
| 215 } // namespace sync_file_system | 207 } // namespace sync_file_system |
| 216 | 208 |
| 217 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_REMOTE_TO_LOCAL_SYNCER_
H_ | 209 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_REMOTE_TO_LOCAL_SYNCER_
H_ |
| OLD | NEW |