| 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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 google_apis::GDataErrorCode error); | 261 google_apis::GDataErrorCode error); |
| 262 void DidGetLargestChangeStampForBatchSync( | 262 void DidGetLargestChangeStampForBatchSync( |
| 263 const SyncStatusCallback& callback, | 263 const SyncStatusCallback& callback, |
| 264 const GURL& origin, | 264 const GURL& origin, |
| 265 const std::string& resource_id, | 265 const std::string& resource_id, |
| 266 google_apis::GDataErrorCode error, | 266 google_apis::GDataErrorCode error, |
| 267 int64 largest_changestamp); | 267 int64 largest_changestamp); |
| 268 void DidGetDirectoryContentForBatchSync( | 268 void DidGetDirectoryContentForBatchSync( |
| 269 const SyncStatusCallback& callback, | 269 const SyncStatusCallback& callback, |
| 270 const GURL& origin, | 270 const GURL& origin, |
| 271 const std::string& resource_id, |
| 271 int64 largest_changestamp, | 272 int64 largest_changestamp, |
| 272 google_apis::GDataErrorCode error, | 273 google_apis::GDataErrorCode error, |
| 273 scoped_ptr<google_apis::ResourceList> feed); | 274 scoped_ptr<google_apis::ResourceList> feed); |
| 274 | 275 |
| 275 // Remote synchronization related methods. | 276 // Remote synchronization related methods. |
| 276 void DidPrepareForProcessRemoteChange( | 277 void DidPrepareForProcessRemoteChange( |
| 277 scoped_ptr<ProcessRemoteChangeParam> param, | 278 scoped_ptr<ProcessRemoteChangeParam> param, |
| 278 SyncStatusCode status, | 279 SyncStatusCode status, |
| 279 const SyncFileMetadata& metadata, | 280 const SyncFileMetadata& metadata, |
| 280 const FileChangeList& changes); | 281 const FileChangeList& changes); |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 // is false even if state_ is REMOTE_SERVICE_OK). | 418 // is false even if state_ is REMOTE_SERVICE_OK). |
| 418 RemoteServiceState state_; | 419 RemoteServiceState state_; |
| 419 | 420 |
| 420 // Indicates if sync is enabled or not. This flag can be turned on or | 421 // Indicates if sync is enabled or not. This flag can be turned on or |
| 421 // off by SetSyncEnabled() method. To start synchronization | 422 // off by SetSyncEnabled() method. To start synchronization |
| 422 // this needs to be true and state_ needs to be REMOTE_SERVICE_OK. | 423 // this needs to be true and state_ needs to be REMOTE_SERVICE_OK. |
| 423 bool sync_enabled_; | 424 bool sync_enabled_; |
| 424 | 425 |
| 425 int64 largest_fetched_changestamp_; | 426 int64 largest_fetched_changestamp_; |
| 426 | 427 |
| 427 std::set<GURL> pending_batch_sync_origins_; | 428 std::map<GURL, std::string> pending_batch_sync_origins_; |
| 428 | 429 |
| 429 // Is set to true when there's a fair possibility that we have some | 430 // Is set to true when there's a fair possibility that we have some |
| 430 // remote changes that haven't been fetched yet. | 431 // remote changes that haven't been fetched yet. |
| 431 // | 432 // |
| 432 // This flag is set when: | 433 // This flag is set when: |
| 433 // - This gets invalidation notification, | 434 // - This gets invalidation notification, |
| 434 // - The service is authenticated or becomes online, and | 435 // - The service is authenticated or becomes online, and |
| 435 // - The polling timer is fired. | 436 // - The polling timer is fired. |
| 436 // | 437 // |
| 437 // This flag is cleared when: | 438 // This flag is cleared when: |
| 438 // - A batch or incremental sync has been started, and | 439 // - A batch or incremental sync has been started, and |
| 439 // - When all pending batch sync tasks have been finished. | 440 // - When all pending batch sync tasks have been finished. |
| 440 bool may_have_unfetched_changes_; | 441 bool may_have_unfetched_changes_; |
| 441 | 442 |
| 442 ObserverList<Observer> service_observers_; | 443 ObserverList<Observer> service_observers_; |
| 443 ObserverList<FileStatusObserver> file_status_observers_; | 444 ObserverList<FileStatusObserver> file_status_observers_; |
| 444 | 445 |
| 445 RemoteChangeHandler remote_change_handler_; | 446 RemoteChangeHandler remote_change_handler_; |
| 446 RemoteChangeProcessor* remote_change_processor_; | 447 RemoteChangeProcessor* remote_change_processor_; |
| 447 | 448 |
| 448 ConflictResolutionPolicy conflict_resolution_; | 449 ConflictResolutionPolicy conflict_resolution_; |
| 449 | 450 |
| 450 DISALLOW_COPY_AND_ASSIGN(DriveFileSyncService); | 451 DISALLOW_COPY_AND_ASSIGN(DriveFileSyncService); |
| 451 }; | 452 }; |
| 452 | 453 |
| 453 } // namespace sync_file_system | 454 } // namespace sync_file_system |
| 454 | 455 |
| 455 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_FILE_SYNC_SERVICE_H_ | 456 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_FILE_SYNC_SERVICE_H_ |
| OLD | NEW |