| OLD | NEW |
| 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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 void CompleteRemoteSync( | 273 void CompleteRemoteSync( |
| 274 scoped_ptr<ProcessRemoteChangeParam> param, | 274 scoped_ptr<ProcessRemoteChangeParam> param, |
| 275 fileapi::SyncStatusCode status); | 275 fileapi::SyncStatusCode status); |
| 276 void AbortRemoteSync( | 276 void AbortRemoteSync( |
| 277 scoped_ptr<ProcessRemoteChangeParam> param, | 277 scoped_ptr<ProcessRemoteChangeParam> param, |
| 278 fileapi::SyncStatusCode status); | 278 fileapi::SyncStatusCode status); |
| 279 void FinalizeRemoteSync( | 279 void FinalizeRemoteSync( |
| 280 scoped_ptr<ProcessRemoteChangeParam> param, | 280 scoped_ptr<ProcessRemoteChangeParam> param, |
| 281 fileapi::SyncStatusCode status); | 281 fileapi::SyncStatusCode status); |
| 282 | 282 |
| 283 void AppendNewRemoteChange(const GURL& origin, | 283 // Returns true if |pending_changes_| was updated. |
| 284 bool AppendNewRemoteChange(const GURL& origin, |
| 284 const google_apis::DocumentEntry& entry, | 285 const google_apis::DocumentEntry& entry, |
| 285 int64 changestamp, | 286 int64 changestamp, |
| 286 RemoteSyncType sync_type); | 287 RemoteSyncType sync_type); |
| 287 void RemoveRemoteChange(const fileapi::FileSystemURL& url); | 288 void RemoveRemoteChange(const fileapi::FileSystemURL& url); |
| 288 void MaybeMarkAsIncrementalSyncOrigin(const GURL& origin); | 289 void MaybeMarkAsIncrementalSyncOrigin(const GURL& origin); |
| 289 | 290 |
| 290 // This returns false if no change is found for the |url|. | 291 // This returns false if no change is found for the |url|. |
| 291 bool GetPendingChangeForFileSystemURL(const fileapi::FileSystemURL& url, | 292 bool GetPendingChangeForFileSystemURL(const fileapi::FileSystemURL& url, |
| 292 RemoteChange* change) const; | 293 RemoteChange* change) const; |
| 293 | 294 |
| 294 // A wrapper implementation to GDataErrorCodeToSyncStatusCode which returns | 295 // A wrapper implementation to GDataErrorCodeToSyncStatusCode which returns |
| 295 // authentication error if the user is not signed in. | 296 // authentication error if the user is not signed in. |
| 296 fileapi::SyncStatusCode GDataErrorCodeToSyncStatusCodeWrapper( | 297 fileapi::SyncStatusCode GDataErrorCodeToSyncStatusCodeWrapper( |
| 297 google_apis::GDataErrorCode error) const; | 298 google_apis::GDataErrorCode error) const; |
| 298 | 299 |
| 299 FilePath temporary_file_dir_; | 300 FilePath temporary_file_dir_; |
| 300 | 301 |
| 301 void FetchChangesForIncrementalSync(); | 302 void FetchChangesForIncrementalSync(); |
| 302 void DidFetchChangesForIncrementalSync( | 303 void DidFetchChangesForIncrementalSync( |
| 303 scoped_ptr<TaskToken> token, | 304 scoped_ptr<TaskToken> token, |
| 305 bool has_new_changes, |
| 304 google_apis::GDataErrorCode error, | 306 google_apis::GDataErrorCode error, |
| 305 scoped_ptr<google_apis::DocumentFeed> changes); | 307 scoped_ptr<google_apis::DocumentFeed> changes); |
| 306 bool GetOriginForEntry(const google_apis::DocumentEntry& entry, GURL* origin); | 308 bool GetOriginForEntry(const google_apis::DocumentEntry& entry, GURL* origin); |
| 307 void SchedulePolling(); | 309 void SchedulePolling(); |
| 308 | 310 |
| 309 scoped_ptr<DriveMetadataStore> metadata_store_; | 311 scoped_ptr<DriveMetadataStore> metadata_store_; |
| 310 scoped_ptr<DriveFileSyncClient> sync_client_; | 312 scoped_ptr<DriveFileSyncClient> sync_client_; |
| 311 | 313 |
| 312 fileapi::SyncStatusCode last_operation_status_; | 314 fileapi::SyncStatusCode last_operation_status_; |
| 313 RemoteServiceState state_; | 315 RemoteServiceState state_; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 336 // Use WeakPtrFactory instead of SupportsWeakPtr to revoke the weak pointer | 338 // Use WeakPtrFactory instead of SupportsWeakPtr to revoke the weak pointer |
| 337 // in |token_|. | 339 // in |token_|. |
| 338 base::WeakPtrFactory<DriveFileSyncService> weak_factory_; | 340 base::WeakPtrFactory<DriveFileSyncService> weak_factory_; |
| 339 | 341 |
| 340 DISALLOW_COPY_AND_ASSIGN(DriveFileSyncService); | 342 DISALLOW_COPY_AND_ASSIGN(DriveFileSyncService); |
| 341 }; | 343 }; |
| 342 | 344 |
| 343 } // namespace sync_file_system | 345 } // namespace sync_file_system |
| 344 | 346 |
| 345 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_FILE_SYNC_SERVICE_H_ | 347 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_FILE_SYNC_SERVICE_H_ |
| OLD | NEW |