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

Side by Side Diff: chrome/browser/sync_file_system/drive_file_sync_service.h

Issue 13986011: SyncFS: Introduce RemoteSyncOperationResolver for directory operation support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add RemoteSyncOperationResolver and unit tests Created 7 years, 8 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_FILE_SYNC_SERVICE_H_ 5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_FILE_SYNC_SERVICE_H_
6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_FILE_SYNC_SERVICE_H_ 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_FILE_SYNC_SERVICE_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 LOCAL_SYNC_OPERATION_ADD, 195 LOCAL_SYNC_OPERATION_ADD,
196 LOCAL_SYNC_OPERATION_UPDATE, 196 LOCAL_SYNC_OPERATION_UPDATE,
197 LOCAL_SYNC_OPERATION_DELETE, 197 LOCAL_SYNC_OPERATION_DELETE,
198 LOCAL_SYNC_OPERATION_NONE, 198 LOCAL_SYNC_OPERATION_NONE,
199 LOCAL_SYNC_OPERATION_NONE_CONFLICTED, 199 LOCAL_SYNC_OPERATION_NONE_CONFLICTED,
200 LOCAL_SYNC_OPERATION_CONFLICT, 200 LOCAL_SYNC_OPERATION_CONFLICT,
201 LOCAL_SYNC_OPERATION_RESOLVE_TO_REMOTE, 201 LOCAL_SYNC_OPERATION_RESOLVE_TO_REMOTE,
202 LOCAL_SYNC_OPERATION_FAIL, 202 LOCAL_SYNC_OPERATION_FAIL,
203 }; 203 };
204 204
205 enum RemoteSyncOperationType {
206 REMOTE_SYNC_OPERATION_ADD_FILE,
207 REMOTE_SYNC_OPERATION_UPDATE_FILE,
208 REMOTE_SYNC_OPERATION_DELETE_FILE,
209 REMOTE_SYNC_OPERATION_NONE,
210 REMOTE_SYNC_OPERATION_CONFLICT,
211 REMOTE_SYNC_OPERATION_RESOLVE_TO_LOCAL,
212 REMOTE_SYNC_OPERATION_RESOLVE_TO_REMOTE,
213 REMOTE_SYNC_OPERATION_DELETE_METADATA,
214 REMOTE_SYNC_OPERATION_FAIL,
215 };
216
217 typedef base::Callback<void(const base::Time& time, 205 typedef base::Callback<void(const base::Time& time,
218 SyncStatusCode status)> UpdatedTimeCallback; 206 SyncStatusCode status)> UpdatedTimeCallback;
219 typedef base::Callback< 207 typedef base::Callback<
220 void(SyncStatusCode status, 208 void(SyncStatusCode status,
221 const std::string& resource_id)> ResourceIdCallback; 209 const std::string& resource_id)> ResourceIdCallback;
222 210
223 DriveFileSyncService(Profile* profile, 211 DriveFileSyncService(Profile* profile,
224 const base::FilePath& base_dir, 212 const base::FilePath& base_dir,
225 scoped_ptr<DriveFileSyncClientInterface> sync_client, 213 scoped_ptr<DriveFileSyncClientInterface> sync_client,
226 scoped_ptr<DriveMetadataStore> metadata_store); 214 scoped_ptr<DriveMetadataStore> metadata_store);
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 scoped_ptr<TaskToken> token, 323 scoped_ptr<TaskToken> token,
336 const SyncStatusCallback& callback, 324 const SyncStatusCallback& callback,
337 SyncStatusCode status); 325 SyncStatusCode status);
338 326
339 // Remote synchronization related methods. 327 // Remote synchronization related methods.
340 void DidPrepareForProcessRemoteChange( 328 void DidPrepareForProcessRemoteChange(
341 scoped_ptr<ProcessRemoteChangeParam> param, 329 scoped_ptr<ProcessRemoteChangeParam> param,
342 SyncStatusCode status, 330 SyncStatusCode status,
343 const SyncFileMetadata& metadata, 331 const SyncFileMetadata& metadata,
344 const FileChangeList& changes); 332 const FileChangeList& changes);
345 RemoteSyncOperationType ResolveRemoteSyncOperationType(
346 const FileChange& remote_file_change,
347 ProcessRemoteChangeParam* param,
348 const FileChangeList& local_changes,
349 bool missing_local_file);
350 void DidResolveConflictToLocalChange( 333 void DidResolveConflictToLocalChange(
351 scoped_ptr<ProcessRemoteChangeParam> param, 334 scoped_ptr<ProcessRemoteChangeParam> param,
352 SyncStatusCode status); 335 SyncStatusCode status);
353 void DownloadForRemoteSync( 336 void DownloadForRemoteSync(
354 scoped_ptr<ProcessRemoteChangeParam> param); 337 scoped_ptr<ProcessRemoteChangeParam> param);
355 void DidGetTemporaryFileForDownload( 338 void DidGetTemporaryFileForDownload(
356 scoped_ptr<ProcessRemoteChangeParam> param, 339 scoped_ptr<ProcessRemoteChangeParam> param,
357 bool success); 340 bool success);
358 void DidDownloadFileForRemoteSync( 341 void DidDownloadFileForRemoteSync(
359 scoped_ptr<ProcessRemoteChangeParam> param, 342 scoped_ptr<ProcessRemoteChangeParam> param,
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 // Use WeakPtrFactory instead of SupportsWeakPtr to revoke the weak pointer 520 // Use WeakPtrFactory instead of SupportsWeakPtr to revoke the weak pointer
538 // in |token_|. 521 // in |token_|.
539 base::WeakPtrFactory<DriveFileSyncService> weak_factory_; 522 base::WeakPtrFactory<DriveFileSyncService> weak_factory_;
540 523
541 DISALLOW_COPY_AND_ASSIGN(DriveFileSyncService); 524 DISALLOW_COPY_AND_ASSIGN(DriveFileSyncService);
542 }; 525 };
543 526
544 } // namespace sync_file_system 527 } // namespace sync_file_system
545 528
546 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_FILE_SYNC_SERVICE_H_ 529 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_FILE_SYNC_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698