| 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 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 20 matching lines...) Expand all Loading... |
| 31 } // namespace sync_pb | 31 } // namespace sync_pb |
| 32 | 32 |
| 33 namespace syncer { | 33 namespace syncer { |
| 34 | 34 |
| 35 class BaseTransaction; | 35 class BaseTransaction; |
| 36 class Encryptor; | 36 class Encryptor; |
| 37 struct Experiments; | 37 struct Experiments; |
| 38 class ExtensionsActivityMonitor; | 38 class ExtensionsActivityMonitor; |
| 39 class HttpPostProviderFactory; | 39 class HttpPostProviderFactory; |
| 40 class InternalComponentsFactory; | 40 class InternalComponentsFactory; |
| 41 class InvalidationHandler; |
| 42 class Invalidator; |
| 41 class JsBackend; | 43 class JsBackend; |
| 42 class JsEventHandler; | 44 class JsEventHandler; |
| 43 class SyncEncryptionHandler; | 45 class SyncEncryptionHandler; |
| 44 class SyncNotifier; | |
| 45 class SyncNotifierObserver; | |
| 46 class SyncScheduler; | 46 class SyncScheduler; |
| 47 class UnrecoverableErrorHandler; | 47 class UnrecoverableErrorHandler; |
| 48 struct UserShare; | 48 struct UserShare; |
| 49 | 49 |
| 50 namespace sessions { | 50 namespace sessions { |
| 51 class SyncSessionSnapshot; | 51 class SyncSessionSnapshot; |
| 52 } // namespace sessions | 52 } // namespace sessions |
| 53 | 53 |
| 54 // Used by SyncManager::OnConnectionStatusChange(). | 54 // Used by SyncManager::OnConnectionStatusChange(). |
| 55 enum ConnectionStatus { | 55 enum ConnectionStatus { |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 // |sync_server_and_path| and |sync_server_port| represent the Chrome sync | 283 // |sync_server_and_path| and |sync_server_port| represent the Chrome sync |
| 284 // server to use, and |use_ssl| specifies whether to communicate securely; | 284 // server to use, and |use_ssl| specifies whether to communicate securely; |
| 285 // the default is false. | 285 // the default is false. |
| 286 // |blocking_task_runner| is a TaskRunner to be used for tasks that | 286 // |blocking_task_runner| is a TaskRunner to be used for tasks that |
| 287 // may block on disk I/O. | 287 // may block on disk I/O. |
| 288 // |post_factory| will be owned internally and used to create | 288 // |post_factory| will be owned internally and used to create |
| 289 // instances of an HttpPostProvider. | 289 // instances of an HttpPostProvider. |
| 290 // |model_safe_worker| ownership is given to the SyncManager. | 290 // |model_safe_worker| ownership is given to the SyncManager. |
| 291 // |user_agent| is a 7-bit ASCII string suitable for use as the User-Agent | 291 // |user_agent| is a 7-bit ASCII string suitable for use as the User-Agent |
| 292 // HTTP header. Used internally when collecting stats to classify clients. | 292 // HTTP header. Used internally when collecting stats to classify clients. |
| 293 // |sync_notifier| is owned and used to listen for notifications. | 293 // |invalidator| is owned and used to listen for invalidations. |
| 294 // |restored_key_for_bootstrapping| is the key used to boostrap the | 294 // |restored_key_for_bootstrapping| is the key used to boostrap the |
| 295 // cryptographer | 295 // cryptographer |
| 296 // |keystore_encryption_enabled| determines whether we enable the keystore | 296 // |keystore_encryption_enabled| determines whether we enable the keystore |
| 297 // encryption functionality in the cryptographer/nigori. | 297 // encryption functionality in the cryptographer/nigori. |
| 298 // |report_unrecoverable_error_function| may be NULL. | 298 // |report_unrecoverable_error_function| may be NULL. |
| 299 // | 299 // |
| 300 // TODO(akalin): Replace the |post_factory| parameter with a | 300 // TODO(akalin): Replace the |post_factory| parameter with a |
| 301 // URLFetcher parameter. | 301 // URLFetcher parameter. |
| 302 virtual void Init( | 302 virtual void Init( |
| 303 const FilePath& database_location, | 303 const FilePath& database_location, |
| 304 const WeakHandle<JsEventHandler>& event_handler, | 304 const WeakHandle<JsEventHandler>& event_handler, |
| 305 const std::string& sync_server_and_path, | 305 const std::string& sync_server_and_path, |
| 306 int sync_server_port, | 306 int sync_server_port, |
| 307 bool use_ssl, | 307 bool use_ssl, |
| 308 const scoped_refptr<base::TaskRunner>& blocking_task_runner, | 308 const scoped_refptr<base::TaskRunner>& blocking_task_runner, |
| 309 scoped_ptr<HttpPostProviderFactory> post_factory, | 309 scoped_ptr<HttpPostProviderFactory> post_factory, |
| 310 const std::vector<ModelSafeWorker*>& workers, | 310 const std::vector<ModelSafeWorker*>& workers, |
| 311 ExtensionsActivityMonitor* extensions_activity_monitor, | 311 ExtensionsActivityMonitor* extensions_activity_monitor, |
| 312 ChangeDelegate* change_delegate, | 312 ChangeDelegate* change_delegate, |
| 313 const SyncCredentials& credentials, | 313 const SyncCredentials& credentials, |
| 314 scoped_ptr<SyncNotifier> sync_notifier, | 314 scoped_ptr<Invalidator> invalidator, |
| 315 const std::string& restored_key_for_bootstrapping, | 315 const std::string& restored_key_for_bootstrapping, |
| 316 const std::string& restored_keystore_key_for_bootstrapping, | 316 const std::string& restored_keystore_key_for_bootstrapping, |
| 317 scoped_ptr<InternalComponentsFactory> internal_components_factory, | 317 scoped_ptr<InternalComponentsFactory> internal_components_factory, |
| 318 Encryptor* encryptor, | 318 Encryptor* encryptor, |
| 319 UnrecoverableErrorHandler* unrecoverable_error_handler, | 319 UnrecoverableErrorHandler* unrecoverable_error_handler, |
| 320 ReportUnrecoverableErrorFunction report_unrecoverable_error_function) = 0; | 320 ReportUnrecoverableErrorFunction report_unrecoverable_error_function) = 0; |
| 321 | 321 |
| 322 // Throw an unrecoverable error from a transaction (mostly used for | 322 // Throw an unrecoverable error from a transaction (mostly used for |
| 323 // testing). | 323 // testing). |
| 324 virtual void ThrowUnrecoverableError() = 0; | 324 virtual void ThrowUnrecoverableError() = 0; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 335 // Returns false if an error occurred, true otherwise. | 335 // Returns false if an error occurred, true otherwise. |
| 336 virtual bool PurgePartiallySyncedTypes() = 0; | 336 virtual bool PurgePartiallySyncedTypes() = 0; |
| 337 | 337 |
| 338 // Update tokens that we're using in Sync. Email must stay the same. | 338 // Update tokens that we're using in Sync. Email must stay the same. |
| 339 virtual void UpdateCredentials(const SyncCredentials& credentials) = 0; | 339 virtual void UpdateCredentials(const SyncCredentials& credentials) = 0; |
| 340 | 340 |
| 341 // Called when the user disables or enables a sync type. | 341 // Called when the user disables or enables a sync type. |
| 342 virtual void UpdateEnabledTypes( | 342 virtual void UpdateEnabledTypes( |
| 343 const ModelTypeSet& enabled_types) = 0; | 343 const ModelTypeSet& enabled_types) = 0; |
| 344 | 344 |
| 345 // Forwards to the underlying notifier (see comments in sync_notifier.h). | 345 // Forwards to the underlying invalidator (see comments in invalidator.h). |
| 346 virtual void RegisterInvalidationHandler( | 346 virtual void RegisterInvalidationHandler( |
| 347 SyncNotifierObserver* handler) = 0; | 347 InvalidationHandler* handler) = 0; |
| 348 | 348 |
| 349 // Forwards to the underlying notifier (see comments in sync_notifier.h). | 349 // Forwards to the underlying notifier (see comments in invalidator.h). |
| 350 virtual void UpdateRegisteredInvalidationIds( | 350 virtual void UpdateRegisteredInvalidationIds( |
| 351 SyncNotifierObserver* handler, | 351 InvalidationHandler* handler, |
| 352 const ObjectIdSet& ids) = 0; | 352 const ObjectIdSet& ids) = 0; |
| 353 | 353 |
| 354 // Forwards to the underlying notifier (see comments in sync_notifier.h). | 354 // Forwards to the underlying notifier (see comments in invalidator.h). |
| 355 virtual void UnregisterInvalidationHandler( | 355 virtual void UnregisterInvalidationHandler( |
| 356 SyncNotifierObserver* handler) = 0; | 356 InvalidationHandler* handler) = 0; |
| 357 | 357 |
| 358 // Put the syncer in normal mode ready to perform nudges and polls. | 358 // Put the syncer in normal mode ready to perform nudges and polls. |
| 359 virtual void StartSyncingNormally( | 359 virtual void StartSyncingNormally( |
| 360 const ModelSafeRoutingInfo& routing_info) = 0; | 360 const ModelSafeRoutingInfo& routing_info) = 0; |
| 361 | 361 |
| 362 // Switches the mode of operation to CONFIGURATION_MODE and performs | 362 // Switches the mode of operation to CONFIGURATION_MODE and performs |
| 363 // any configuration tasks needed as determined by the params. Once complete, | 363 // any configuration tasks needed as determined by the params. Once complete, |
| 364 // syncer will remain in CONFIGURATION_MODE until StartSyncingNormally is | 364 // syncer will remain in CONFIGURATION_MODE until StartSyncingNormally is |
| 365 // called. | 365 // called. |
| 366 // |ready_task| is invoked when the configuration completes. | 366 // |ready_task| is invoked when the configuration completes. |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 // any remaining unsynced items. May be called on any thread. | 421 // any remaining unsynced items. May be called on any thread. |
| 422 virtual bool HasUnsyncedItems() = 0; | 422 virtual bool HasUnsyncedItems() = 0; |
| 423 | 423 |
| 424 // Returns the SyncManager's encryption handler. | 424 // Returns the SyncManager's encryption handler. |
| 425 virtual SyncEncryptionHandler* GetEncryptionHandler() = 0; | 425 virtual SyncEncryptionHandler* GetEncryptionHandler() = 0; |
| 426 }; | 426 }; |
| 427 | 427 |
| 428 } // namespace syncer | 428 } // namespace syncer |
| 429 | 429 |
| 430 #endif // SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ | 430 #endif // SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ |
| OLD | NEW |