| 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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 google_apis::GDataErrorCode error); | 232 google_apis::GDataErrorCode error); |
| 233 void DidGetLargestChangeStampForBatchSync( | 233 void DidGetLargestChangeStampForBatchSync( |
| 234 const SyncStatusCallback& callback, | 234 const SyncStatusCallback& callback, |
| 235 const GURL& origin, | 235 const GURL& origin, |
| 236 const std::string& resource_id, | 236 const std::string& resource_id, |
| 237 google_apis::GDataErrorCode error, | 237 google_apis::GDataErrorCode error, |
| 238 int64 largest_changestamp); | 238 int64 largest_changestamp); |
| 239 void DidGetDirectoryContentForBatchSync( | 239 void DidGetDirectoryContentForBatchSync( |
| 240 const SyncStatusCallback& callback, | 240 const SyncStatusCallback& callback, |
| 241 const GURL& origin, | 241 const GURL& origin, |
| 242 const std::string& resource_id, |
| 242 int64 largest_changestamp, | 243 int64 largest_changestamp, |
| 243 google_apis::GDataErrorCode error, | 244 google_apis::GDataErrorCode error, |
| 244 scoped_ptr<google_apis::ResourceList> feed); | 245 scoped_ptr<google_apis::ResourceList> feed); |
| 245 | 246 |
| 246 // Remote synchronization related methods. | 247 // Remote synchronization related methods. |
| 247 void DidPrepareForProcessRemoteChange( | 248 void DidPrepareForProcessRemoteChange( |
| 248 scoped_ptr<ProcessRemoteChangeParam> param, | 249 scoped_ptr<ProcessRemoteChangeParam> param, |
| 249 SyncStatusCode status, | 250 SyncStatusCode status, |
| 250 const SyncFileMetadata& metadata, | 251 const SyncFileMetadata& metadata, |
| 251 const FileChangeList& changes); | 252 const FileChangeList& changes); |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 // is false even if state_ is REMOTE_SERVICE_OK). | 391 // is false even if state_ is REMOTE_SERVICE_OK). |
| 391 RemoteServiceState state_; | 392 RemoteServiceState state_; |
| 392 | 393 |
| 393 // Indicates if sync is enabled or not. This flag can be turned on or | 394 // Indicates if sync is enabled or not. This flag can be turned on or |
| 394 // off by SetSyncEnabled() method. To start synchronization | 395 // off by SetSyncEnabled() method. To start synchronization |
| 395 // this needs to be true and state_ needs to be REMOTE_SERVICE_OK. | 396 // this needs to be true and state_ needs to be REMOTE_SERVICE_OK. |
| 396 bool sync_enabled_; | 397 bool sync_enabled_; |
| 397 | 398 |
| 398 int64 largest_fetched_changestamp_; | 399 int64 largest_fetched_changestamp_; |
| 399 | 400 |
| 400 std::set<GURL> pending_batch_sync_origins_; | 401 std::map<GURL, std::string> pending_batch_sync_origins_; |
| 401 | 402 |
| 402 // Is set to true when there's a fair possibility that we have some | 403 // Is set to true when there's a fair possibility that we have some |
| 403 // remote changes that haven't been fetched yet. | 404 // remote changes that haven't been fetched yet. |
| 404 // | 405 // |
| 405 // This flag is set when: | 406 // This flag is set when: |
| 406 // - This gets invalidation notification, | 407 // - This gets invalidation notification, |
| 407 // - The service is authenticated or becomes online, and | 408 // - The service is authenticated or becomes online, and |
| 408 // - The polling timer is fired. | 409 // - The polling timer is fired. |
| 409 // | 410 // |
| 410 // This flag is cleared when: | 411 // This flag is cleared when: |
| 411 // - A batch or incremental sync has been started, and | 412 // - A batch or incremental sync has been started, and |
| 412 // - When all pending batch sync tasks have been finished. | 413 // - When all pending batch sync tasks have been finished. |
| 413 bool may_have_unfetched_changes_; | 414 bool may_have_unfetched_changes_; |
| 414 | 415 |
| 415 ObserverList<Observer> service_observers_; | 416 ObserverList<Observer> service_observers_; |
| 416 ObserverList<FileStatusObserver> file_status_observers_; | 417 ObserverList<FileStatusObserver> file_status_observers_; |
| 417 | 418 |
| 418 RemoteChangeHandler remote_change_handler_; | 419 RemoteChangeHandler remote_change_handler_; |
| 419 RemoteChangeProcessor* remote_change_processor_; | 420 RemoteChangeProcessor* remote_change_processor_; |
| 420 | 421 |
| 421 ConflictResolutionPolicy conflict_resolution_; | 422 ConflictResolutionPolicy conflict_resolution_; |
| 422 | 423 |
| 423 DISALLOW_COPY_AND_ASSIGN(DriveFileSyncService); | 424 DISALLOW_COPY_AND_ASSIGN(DriveFileSyncService); |
| 424 }; | 425 }; |
| 425 | 426 |
| 426 } // namespace sync_file_system | 427 } // namespace sync_file_system |
| 427 | 428 |
| 428 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_FILE_SYNC_SERVICE_H_ | 429 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_FILE_SYNC_SERVICE_H_ |
| OLD | NEW |