| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ | 5 #ifndef SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ |
| 6 #define SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ | 6 #define SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 CONNECTION_AUTH_ERROR, | 58 CONNECTION_AUTH_ERROR, |
| 59 CONNECTION_SERVER_ERROR | 59 CONNECTION_SERVER_ERROR |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 // Contains everything needed to talk to and identify a user account. | 62 // Contains everything needed to talk to and identify a user account. |
| 63 struct SyncCredentials { | 63 struct SyncCredentials { |
| 64 // The email associated with this account. | 64 // The email associated with this account. |
| 65 std::string email; | 65 std::string email; |
| 66 // The raw authentication token's bytes. | 66 // The raw authentication token's bytes. |
| 67 std::string sync_token; | 67 std::string sync_token; |
| 68 // (optional) The time at which the token was fetched/refreshed. | |
| 69 base::Time sync_token_time; | |
| 70 }; | 68 }; |
| 71 | 69 |
| 72 // SyncManager encapsulates syncable::Directory and serves as the parent of all | 70 // SyncManager encapsulates syncable::Directory and serves as the parent of all |
| 73 // other objects in the sync API. If multiple threads interact with the same | 71 // other objects in the sync API. If multiple threads interact with the same |
| 74 // local sync repository (i.e. the same sqlite database), they should share a | 72 // local sync repository (i.e. the same sqlite database), they should share a |
| 75 // single SyncManager instance. The caller should typically create one | 73 // single SyncManager instance. The caller should typically create one |
| 76 // SyncManager for the lifetime of a user session. | 74 // SyncManager for the lifetime of a user session. |
| 77 // | 75 // |
| 78 // Unless stated otherwise, all methods of SyncManager should be called on the | 76 // Unless stated otherwise, all methods of SyncManager should be called on the |
| 79 // same thread. | 77 // same thread. |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 ExtensionsActivityMonitor* extensions_activity_monitor, | 315 ExtensionsActivityMonitor* extensions_activity_monitor, |
| 318 ChangeDelegate* change_delegate, | 316 ChangeDelegate* change_delegate, |
| 319 const SyncCredentials& credentials, | 317 const SyncCredentials& credentials, |
| 320 scoped_ptr<Invalidator> invalidator, | 318 scoped_ptr<Invalidator> invalidator, |
| 321 const std::string& invalidator_client_id, | 319 const std::string& invalidator_client_id, |
| 322 const std::string& restored_key_for_bootstrapping, | 320 const std::string& restored_key_for_bootstrapping, |
| 323 const std::string& restored_keystore_key_for_bootstrapping, | 321 const std::string& restored_keystore_key_for_bootstrapping, |
| 324 scoped_ptr<InternalComponentsFactory> internal_components_factory, | 322 scoped_ptr<InternalComponentsFactory> internal_components_factory, |
| 325 Encryptor* encryptor, | 323 Encryptor* encryptor, |
| 326 UnrecoverableErrorHandler* unrecoverable_error_handler, | 324 UnrecoverableErrorHandler* unrecoverable_error_handler, |
| 327 ReportUnrecoverableErrorFunction report_unrecoverable_error_function) = 0; | 325 ReportUnrecoverableErrorFunction report_unrecoverable_error_function, |
| 326 bool use_oauth2_token) = 0; |
| 328 | 327 |
| 329 // Throw an unrecoverable error from a transaction (mostly used for | 328 // Throw an unrecoverable error from a transaction (mostly used for |
| 330 // testing). | 329 // testing). |
| 331 virtual void ThrowUnrecoverableError() = 0; | 330 virtual void ThrowUnrecoverableError() = 0; |
| 332 | 331 |
| 333 virtual ModelTypeSet InitialSyncEndedTypes() = 0; | 332 virtual ModelTypeSet InitialSyncEndedTypes() = 0; |
| 334 | 333 |
| 335 // Returns those types within |types| that have an empty progress marker | 334 // Returns those types within |types| that have an empty progress marker |
| 336 // token. | 335 // token. |
| 337 virtual ModelTypeSet GetTypesWithEmptyProgressMarkerToken( | 336 virtual ModelTypeSet GetTypesWithEmptyProgressMarkerToken( |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 // Returns the SyncManager's encryption handler. | 442 // Returns the SyncManager's encryption handler. |
| 444 virtual SyncEncryptionHandler* GetEncryptionHandler() = 0; | 443 virtual SyncEncryptionHandler* GetEncryptionHandler() = 0; |
| 445 | 444 |
| 446 // Ask the SyncManager to fetch updates for the given types. | 445 // Ask the SyncManager to fetch updates for the given types. |
| 447 virtual void RefreshTypes(ModelTypeSet types) = 0; | 446 virtual void RefreshTypes(ModelTypeSet types) = 0; |
| 448 }; | 447 }; |
| 449 | 448 |
| 450 } // namespace syncer | 449 } // namespace syncer |
| 451 | 450 |
| 452 #endif // SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ | 451 #endif // SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ |
| OLD | NEW |