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

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: review fix Created 7 years, 7 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
« no previous file with comments | « no previous file | chrome/browser/sync_file_system/drive_file_sync_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 LOCAL_SYNC_OPERATION_ADD, 192 LOCAL_SYNC_OPERATION_ADD,
193 LOCAL_SYNC_OPERATION_UPDATE, 193 LOCAL_SYNC_OPERATION_UPDATE,
194 LOCAL_SYNC_OPERATION_DELETE, 194 LOCAL_SYNC_OPERATION_DELETE,
195 LOCAL_SYNC_OPERATION_NONE, 195 LOCAL_SYNC_OPERATION_NONE,
196 LOCAL_SYNC_OPERATION_NONE_CONFLICTED, 196 LOCAL_SYNC_OPERATION_NONE_CONFLICTED,
197 LOCAL_SYNC_OPERATION_CONFLICT, 197 LOCAL_SYNC_OPERATION_CONFLICT,
198 LOCAL_SYNC_OPERATION_RESOLVE_TO_REMOTE, 198 LOCAL_SYNC_OPERATION_RESOLVE_TO_REMOTE,
199 LOCAL_SYNC_OPERATION_FAIL, 199 LOCAL_SYNC_OPERATION_FAIL,
200 }; 200 };
201 201
202 enum RemoteSyncOperationType {
203 REMOTE_SYNC_OPERATION_ADD_FILE,
204 REMOTE_SYNC_OPERATION_UPDATE_FILE,
205 REMOTE_SYNC_OPERATION_DELETE_FILE,
206 REMOTE_SYNC_OPERATION_NONE,
207 REMOTE_SYNC_OPERATION_CONFLICT,
208 REMOTE_SYNC_OPERATION_RESOLVE_TO_LOCAL,
209 REMOTE_SYNC_OPERATION_RESOLVE_TO_REMOTE,
210 REMOTE_SYNC_OPERATION_DELETE_METADATA,
211 REMOTE_SYNC_OPERATION_FAIL,
212 };
213
214 typedef base::Callback<void(const base::Time& time, 202 typedef base::Callback<void(const base::Time& time,
215 SyncStatusCode status)> UpdatedTimeCallback; 203 SyncStatusCode status)> UpdatedTimeCallback;
216 typedef base::Callback< 204 typedef base::Callback<
217 void(SyncStatusCode status, 205 void(SyncStatusCode status,
218 const std::string& resource_id)> ResourceIdCallback; 206 const std::string& resource_id)> ResourceIdCallback;
219 207
220 DriveFileSyncService(Profile* profile, 208 DriveFileSyncService(Profile* profile,
221 const base::FilePath& base_dir, 209 const base::FilePath& base_dir,
222 scoped_ptr<DriveFileSyncClientInterface> sync_client, 210 scoped_ptr<DriveFileSyncClientInterface> sync_client,
223 scoped_ptr<DriveMetadataStore> metadata_store); 211 scoped_ptr<DriveMetadataStore> metadata_store);
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 scoped_ptr<TaskToken> token, 320 scoped_ptr<TaskToken> token,
333 const SyncStatusCallback& callback, 321 const SyncStatusCallback& callback,
334 SyncStatusCode status); 322 SyncStatusCode status);
335 323
336 // Remote synchronization related methods. 324 // Remote synchronization related methods.
337 void DidPrepareForProcessRemoteChange( 325 void DidPrepareForProcessRemoteChange(
338 scoped_ptr<ProcessRemoteChangeParam> param, 326 scoped_ptr<ProcessRemoteChangeParam> param,
339 SyncStatusCode status, 327 SyncStatusCode status,
340 const SyncFileMetadata& metadata, 328 const SyncFileMetadata& metadata,
341 const FileChangeList& changes); 329 const FileChangeList& changes);
342 RemoteSyncOperationType ResolveRemoteSyncOperationType(
343 const FileChange& remote_file_change,
344 ProcessRemoteChangeParam* param,
345 const FileChangeList& local_changes,
346 bool missing_local_file);
347 void DidResolveConflictToLocalChange( 330 void DidResolveConflictToLocalChange(
348 scoped_ptr<ProcessRemoteChangeParam> param, 331 scoped_ptr<ProcessRemoteChangeParam> param,
349 SyncStatusCode status); 332 SyncStatusCode status);
350 void DownloadForRemoteSync( 333 void DownloadForRemoteSync(
351 scoped_ptr<ProcessRemoteChangeParam> param); 334 scoped_ptr<ProcessRemoteChangeParam> param);
352 void DidGetTemporaryFileForDownload( 335 void DidGetTemporaryFileForDownload(
353 scoped_ptr<ProcessRemoteChangeParam> param, 336 scoped_ptr<ProcessRemoteChangeParam> param,
354 bool success); 337 bool success);
355 void DidDownloadFileForRemoteSync( 338 void DidDownloadFileForRemoteSync(
356 scoped_ptr<ProcessRemoteChangeParam> param, 339 scoped_ptr<ProcessRemoteChangeParam> param,
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 // Use WeakPtrFactory instead of SupportsWeakPtr to revoke the weak pointer 519 // Use WeakPtrFactory instead of SupportsWeakPtr to revoke the weak pointer
537 // in |token_|. 520 // in |token_|.
538 base::WeakPtrFactory<DriveFileSyncService> weak_factory_; 521 base::WeakPtrFactory<DriveFileSyncService> weak_factory_;
539 522
540 DISALLOW_COPY_AND_ASSIGN(DriveFileSyncService); 523 DISALLOW_COPY_AND_ASSIGN(DriveFileSyncService);
541 }; 524 };
542 525
543 } // namespace sync_file_system 526 } // namespace sync_file_system
544 527
545 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_FILE_SYNC_SERVICE_H_ 528 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_FILE_SYNC_SERVICE_H_
OLDNEW
« 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