| 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_GLUE_SYNC_BACKEND_HOST_H_ | 5 #ifndef CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ |
| 6 #define CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ | 6 #define CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 16 #include "base/threading/thread.h" | 16 #include "base/threading/thread.h" |
| 17 #include "chrome/browser/invalidation/invalidation_service.h" | |
| 18 #include "chrome/browser/sync/glue/backend_data_type_configurer.h" | 17 #include "chrome/browser/sync/glue/backend_data_type_configurer.h" |
| 19 #include "chrome/browser/sync/glue/chrome_extensions_activity_monitor.h" | 18 #include "chrome/browser/sync/glue/chrome_extensions_activity_monitor.h" |
| 20 #include "content/public/browser/notification_observer.h" | 19 #include "content/public/browser/notification_observer.h" |
| 21 #include "content/public/browser/notification_registrar.h" | 20 #include "content/public/browser/notification_registrar.h" |
| 22 #include "google_apis/gaia/google_service_auth_error.h" | 21 #include "google_apis/gaia/google_service_auth_error.h" |
| 23 #include "googleurl/src/gurl.h" | 22 #include "googleurl/src/gurl.h" |
| 24 #include "sync/internal_api/public/base/model_type.h" | 23 #include "sync/internal_api/public/base/model_type.h" |
| 25 #include "sync/internal_api/public/configure_reason.h" | 24 #include "sync/internal_api/public/configure_reason.h" |
| 26 #include "sync/internal_api/public/engine/model_safe_worker.h" | 25 #include "sync/internal_api/public/engine/model_safe_worker.h" |
| 27 #include "sync/internal_api/public/sessions/sync_session_snapshot.h" | 26 #include "sync/internal_api/public/sessions/sync_session_snapshot.h" |
| 28 #include "sync/internal_api/public/sync_encryption_handler.h" | 27 #include "sync/internal_api/public/sync_encryption_handler.h" |
| 29 #include "sync/internal_api/public/sync_manager.h" | 28 #include "sync/internal_api/public/sync_manager.h" |
| 30 #include "sync/internal_api/public/util/report_unrecoverable_error_function.h" | 29 #include "sync/internal_api/public/util/report_unrecoverable_error_function.h" |
| 31 #include "sync/internal_api/public/util/unrecoverable_error_handler.h" | 30 #include "sync/internal_api/public/util/unrecoverable_error_handler.h" |
| 32 #include "sync/internal_api/public/util/weak_handle.h" | 31 #include "sync/internal_api/public/util/weak_handle.h" |
| 33 #include "sync/notifier/invalidation_handler.h" | 32 #include "sync/notifier/invalidation_handler.h" |
| 33 #include "sync/notifier/invalidator_factory.h" |
| 34 #include "sync/protocol/encryption.pb.h" | 34 #include "sync/protocol/encryption.pb.h" |
| 35 #include "sync/protocol/sync_protocol_error.h" | 35 #include "sync/protocol/sync_protocol_error.h" |
| 36 | 36 |
| 37 class Profile; | 37 class Profile; |
| 38 | 38 |
| 39 namespace base { | 39 namespace base { |
| 40 class MessageLoop; | 40 class MessageLoop; |
| 41 } | 41 } |
| 42 | 42 |
| 43 namespace syncer { | 43 namespace syncer { |
| 44 class SyncManagerFactory; | 44 class SyncManagerFactory; |
| 45 } | 45 } |
| 46 | 46 |
| 47 namespace invalidation { |
| 48 class InvalidatorStorage; |
| 49 } |
| 50 |
| 47 namespace browser_sync { | 51 namespace browser_sync { |
| 48 | 52 |
| 53 class AndroidInvalidatorBridge; |
| 49 class ChangeProcessor; | 54 class ChangeProcessor; |
| 50 class InvalidatorStorage; | |
| 51 class SyncBackendRegistrar; | 55 class SyncBackendRegistrar; |
| 52 class SyncPrefs; | 56 class SyncPrefs; |
| 53 class SyncedDeviceTracker; | 57 class SyncedDeviceTracker; |
| 54 struct Experiments; | 58 struct Experiments; |
| 55 | 59 |
| 56 // SyncFrontend is the interface used by SyncBackendHost to communicate with | 60 // SyncFrontend is the interface used by SyncBackendHost to communicate with |
| 57 // the entity that created it and, presumably, is interested in sync-related | 61 // the entity that created it and, presumably, is interested in sync-related |
| 58 // activity. | 62 // activity. |
| 59 // NOTE: All methods will be invoked by a SyncBackendHost on the same thread | 63 // NOTE: All methods will be invoked by a SyncBackendHost on the same thread |
| 60 // used to create that SyncBackendHost. | 64 // used to create that SyncBackendHost. |
| 61 class SyncFrontend { | 65 class SyncFrontend : public syncer::InvalidationHandler { |
| 62 public: | 66 public: |
| 63 SyncFrontend() {} | 67 SyncFrontend() {} |
| 64 | 68 |
| 65 // The backend has completed initialization and it is now ready to | 69 // The backend has completed initialization and it is now ready to |
| 66 // accept and process changes. If success is false, initialization | 70 // accept and process changes. If success is false, initialization |
| 67 // wasn't able to be completed and should be retried. | 71 // wasn't able to be completed and should be retried. |
| 68 // | 72 // |
| 69 // |js_backend| is what about:sync interacts with; it's different | 73 // |js_backend| is what about:sync interacts with; it's different |
| 70 // from the 'Backend' in 'OnBackendInitialized' (unfortunately). It | 74 // from the 'Backend' in 'OnBackendInitialized' (unfortunately). It |
| 71 // is initialized only if |success| is true. | 75 // is initialized only if |success| is true. |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 private: | 146 private: |
| 143 DISALLOW_COPY_AND_ASSIGN(SyncFrontend); | 147 DISALLOW_COPY_AND_ASSIGN(SyncFrontend); |
| 144 }; | 148 }; |
| 145 | 149 |
| 146 // A UI-thread safe API into the sync backend that "hosts" the top-level | 150 // A UI-thread safe API into the sync backend that "hosts" the top-level |
| 147 // syncapi element, the SyncManager, on its own thread. This class handles | 151 // syncapi element, the SyncManager, on its own thread. This class handles |
| 148 // dispatch of potentially blocking calls to appropriate threads and ensures | 152 // dispatch of potentially blocking calls to appropriate threads and ensures |
| 149 // that the SyncFrontend is only accessed on the UI loop. | 153 // that the SyncFrontend is only accessed on the UI loop. |
| 150 class SyncBackendHost | 154 class SyncBackendHost |
| 151 : public BackendDataTypeConfigurer, | 155 : public BackendDataTypeConfigurer, |
| 152 public content::NotificationObserver, | 156 public content::NotificationObserver { |
| 153 public syncer::InvalidationHandler { | |
| 154 public: | 157 public: |
| 155 typedef syncer::SyncStatus Status; | 158 typedef syncer::SyncStatus Status; |
| 156 | 159 |
| 157 // Create a SyncBackendHost with a reference to the |frontend| that | 160 // Create a SyncBackendHost with a reference to the |frontend| that |
| 158 // it serves and communicates to via the SyncFrontend interface (on | 161 // it serves and communicates to via the SyncFrontend interface (on |
| 159 // the same thread it used to call the constructor). Must outlive | 162 // the same thread it used to call the constructor). Must outlive |
| 160 // |sync_prefs| and |invalidator_storage|. | 163 // |sync_prefs| and |invalidator_storage|. |
| 161 SyncBackendHost( | 164 SyncBackendHost( |
| 162 const std::string& name, | 165 const std::string& name, |
| 163 Profile* profile, | 166 Profile* profile, |
| 164 const base::WeakPtr<SyncPrefs>& sync_prefs); | 167 const base::WeakPtr<SyncPrefs>& sync_prefs, |
| 168 // TODO(tim): Temporary, remove when bug 124137 finished. |
| 169 const base::WeakPtr<invalidation::InvalidatorStorage>& |
| 170 invalidator_storage); |
| 165 | 171 |
| 166 // For testing. | 172 // For testing. |
| 167 // TODO(skrul): Extract an interface so this is not needed. | 173 // TODO(skrul): Extract an interface so this is not needed. |
| 168 explicit SyncBackendHost(Profile* profile); | 174 explicit SyncBackendHost(Profile* profile); |
| 169 virtual ~SyncBackendHost(); | 175 virtual ~SyncBackendHost(); |
| 170 | 176 |
| 171 // Called on |frontend_loop_| to kick off asynchronous initialization. | 177 // Called on |frontend_loop_| to kick off asynchronous initialization. |
| 172 // As a fallback when no cached auth information is available, try to | 178 // As a fallback when no cached auth information is available, try to |
| 173 // bootstrap authentication using |lsid|, if it isn't empty. | 179 // bootstrap authentication using |lsid|, if it isn't empty. |
| 174 // Optionally delete the Sync Data folder (if it's corrupt). | 180 // Optionally delete the Sync Data folder (if it's corrupt). |
| 175 // |report_unrecoverable_error_function| can be NULL. | 181 // |report_unrecoverable_error_function| can be NULL. |
| 176 // Note: |unrecoverable_error_handler| may be invoked from any thread. | 182 // Note: |unrecoverable_error_handler| may be invoked from any thread. |
| 177 void Initialize( | 183 void Initialize( |
| 178 SyncFrontend* frontend, | 184 SyncFrontend* frontend, |
| 179 const syncer::WeakHandle<syncer::JsEventHandler>& event_handler, | 185 const syncer::WeakHandle<syncer::JsEventHandler>& event_handler, |
| 180 const GURL& service_url, | 186 const GURL& service_url, |
| 181 const syncer::SyncCredentials& credentials, | 187 const syncer::SyncCredentials& credentials, |
| 182 bool delete_sync_data_folder, | 188 bool delete_sync_data_folder, |
| 183 syncer::SyncManagerFactory* sync_manager_factory, | 189 syncer::SyncManagerFactory* sync_manager_factory, |
| 184 syncer::UnrecoverableErrorHandler* unrecoverable_error_handler, | 190 syncer::UnrecoverableErrorHandler* unrecoverable_error_handler, |
| 185 syncer::ReportUnrecoverableErrorFunction | 191 syncer::ReportUnrecoverableErrorFunction |
| 186 report_unrecoverable_error_function); | 192 report_unrecoverable_error_function); |
| 187 | 193 |
| 188 // Called on |frontend_loop| to update SyncCredentials. | 194 // Called on |frontend_loop| to update SyncCredentials. |
| 189 virtual void UpdateCredentials(const syncer::SyncCredentials& credentials); | 195 virtual void UpdateCredentials(const syncer::SyncCredentials& credentials); |
| 190 | 196 |
| 197 // Registers the underlying frontend for the given IDs to the underlying |
| 198 // notifier. This lasts until StopSyncingForShutdown() is called. |
| 199 void UpdateRegisteredInvalidationIds(const syncer::ObjectIdSet& ids); |
| 200 |
| 201 // Forwards an invalidation acknowledgement to the underlying notifier. |
| 202 void AcknowledgeInvalidation(const invalidation::ObjectId& id, |
| 203 const syncer::AckHandle& ack_handle); |
| 204 |
| 191 // This starts the SyncerThread running a Syncer object to communicate with | 205 // This starts the SyncerThread running a Syncer object to communicate with |
| 192 // sync servers. Until this is called, no changes will leave or enter this | 206 // sync servers. Until this is called, no changes will leave or enter this |
| 193 // browser from the cloud / sync servers. | 207 // browser from the cloud / sync servers. |
| 194 // Called on |frontend_loop_|. | 208 // Called on |frontend_loop_|. |
| 195 virtual void StartSyncingWithServer(); | 209 virtual void StartSyncingWithServer(); |
| 196 | 210 |
| 197 // Called on |frontend_loop_| to asynchronously set a new passphrase for | 211 // Called on |frontend_loop_| to asynchronously set a new passphrase for |
| 198 // encryption. Note that it is an error to call SetEncryptionPassphrase under | 212 // encryption. Note that it is an error to call SetEncryptionPassphrase under |
| 199 // the following circumstances: | 213 // the following circumstances: |
| 200 // - An explicit passphrase has already been set | 214 // - An explicit passphrase has already been set |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 DoInitializeOptions( | 318 DoInitializeOptions( |
| 305 base::MessageLoop* sync_loop, | 319 base::MessageLoop* sync_loop, |
| 306 SyncBackendRegistrar* registrar, | 320 SyncBackendRegistrar* registrar, |
| 307 const syncer::ModelSafeRoutingInfo& routing_info, | 321 const syncer::ModelSafeRoutingInfo& routing_info, |
| 308 const std::vector<syncer::ModelSafeWorker*>& workers, | 322 const std::vector<syncer::ModelSafeWorker*>& workers, |
| 309 syncer::ExtensionsActivityMonitor* extensions_activity_monitor, | 323 syncer::ExtensionsActivityMonitor* extensions_activity_monitor, |
| 310 const syncer::WeakHandle<syncer::JsEventHandler>& event_handler, | 324 const syncer::WeakHandle<syncer::JsEventHandler>& event_handler, |
| 311 const GURL& service_url, | 325 const GURL& service_url, |
| 312 MakeHttpBridgeFactoryFn make_http_bridge_factory_fn, | 326 MakeHttpBridgeFactoryFn make_http_bridge_factory_fn, |
| 313 const syncer::SyncCredentials& credentials, | 327 const syncer::SyncCredentials& credentials, |
| 314 const std::string& invalidator_client_id, | 328 AndroidInvalidatorBridge* android_invalidator_bridge, |
| 329 syncer::InvalidatorFactory* invalidator_factory, |
| 315 syncer::SyncManagerFactory* sync_manager_factory, | 330 syncer::SyncManagerFactory* sync_manager_factory, |
| 316 bool delete_sync_data_folder, | 331 bool delete_sync_data_folder, |
| 317 const std::string& restored_key_for_bootstrapping, | 332 const std::string& restored_key_for_bootstrapping, |
| 318 const std::string& restored_keystore_key_for_bootstrapping, | 333 const std::string& restored_keystore_key_for_bootstrapping, |
| 319 syncer::InternalComponentsFactory* internal_components_factory, | 334 syncer::InternalComponentsFactory* internal_components_factory, |
| 320 syncer::UnrecoverableErrorHandler* unrecoverable_error_handler, | 335 syncer::UnrecoverableErrorHandler* unrecoverable_error_handler, |
| 321 syncer::ReportUnrecoverableErrorFunction | 336 syncer::ReportUnrecoverableErrorFunction |
| 322 report_unrecoverable_error_function, | 337 report_unrecoverable_error_function, |
| 323 bool use_oauth2_token); | 338 bool use_oauth2_token, |
| 339 bool create_invalidator); |
| 324 ~DoInitializeOptions(); | 340 ~DoInitializeOptions(); |
| 325 | 341 |
| 326 base::MessageLoop* sync_loop; | 342 base::MessageLoop* sync_loop; |
| 327 SyncBackendRegistrar* registrar; | 343 SyncBackendRegistrar* registrar; |
| 328 syncer::ModelSafeRoutingInfo routing_info; | 344 syncer::ModelSafeRoutingInfo routing_info; |
| 329 std::vector<syncer::ModelSafeWorker*> workers; | 345 std::vector<syncer::ModelSafeWorker*> workers; |
| 330 syncer::ExtensionsActivityMonitor* extensions_activity_monitor; | 346 syncer::ExtensionsActivityMonitor* extensions_activity_monitor; |
| 331 syncer::WeakHandle<syncer::JsEventHandler> event_handler; | 347 syncer::WeakHandle<syncer::JsEventHandler> event_handler; |
| 332 GURL service_url; | 348 GURL service_url; |
| 333 // Overridden by tests. | 349 // Overridden by tests. |
| 334 MakeHttpBridgeFactoryFn make_http_bridge_factory_fn; | 350 MakeHttpBridgeFactoryFn make_http_bridge_factory_fn; |
| 335 syncer::SyncCredentials credentials; | 351 syncer::SyncCredentials credentials; |
| 336 const std::string invalidator_client_id; | 352 AndroidInvalidatorBridge* const android_invalidator_bridge; |
| 353 syncer::InvalidatorFactory* const invalidator_factory; |
| 337 syncer::SyncManagerFactory* const sync_manager_factory; | 354 syncer::SyncManagerFactory* const sync_manager_factory; |
| 338 std::string lsid; | 355 std::string lsid; |
| 339 bool delete_sync_data_folder; | 356 bool delete_sync_data_folder; |
| 340 std::string restored_key_for_bootstrapping; | 357 std::string restored_key_for_bootstrapping; |
| 341 std::string restored_keystore_key_for_bootstrapping; | 358 std::string restored_keystore_key_for_bootstrapping; |
| 342 syncer::InternalComponentsFactory* internal_components_factory; | 359 syncer::InternalComponentsFactory* internal_components_factory; |
| 343 syncer::UnrecoverableErrorHandler* unrecoverable_error_handler; | 360 syncer::UnrecoverableErrorHandler* unrecoverable_error_handler; |
| 344 syncer::ReportUnrecoverableErrorFunction | 361 syncer::ReportUnrecoverableErrorFunction |
| 345 report_unrecoverable_error_function; | 362 report_unrecoverable_error_function; |
| 346 bool use_oauth2_token; | 363 bool use_oauth2_token; |
| 364 bool create_invalidator; |
| 347 }; | 365 }; |
| 348 | 366 |
| 349 // Allows tests to perform alternate core initialization work. | 367 // Allows tests to perform alternate core initialization work. |
| 350 virtual void InitCore(const DoInitializeOptions& options); | 368 virtual void InitCore(const DoInitializeOptions& options); |
| 351 | 369 |
| 352 // Request the syncer to reconfigure with the specfied params. | 370 // Request the syncer to reconfigure with the specfied params. |
| 353 // Virtual for testing. | 371 // Virtual for testing. |
| 354 virtual void RequestConfigureSyncer( | 372 virtual void RequestConfigureSyncer( |
| 355 syncer::ConfigureReason reason, | 373 syncer::ConfigureReason reason, |
| 356 syncer::ModelTypeSet to_download, | 374 syncer::ModelTypeSet to_download, |
| 357 syncer::ModelTypeSet to_purge, | 375 syncer::ModelTypeSet to_purge, |
| 358 syncer::ModelTypeSet to_journal, | 376 syncer::ModelTypeSet to_journal, |
| 359 syncer::ModelTypeSet to_unapply, | 377 syncer::ModelTypeSet to_unapply, |
| 360 syncer::ModelTypeSet to_ignore, | 378 syncer::ModelTypeSet to_ignore, |
| 361 const syncer::ModelSafeRoutingInfo& routing_info, | 379 const syncer::ModelSafeRoutingInfo& routing_info, |
| 362 const base::Callback<void(syncer::ModelTypeSet, | 380 const base::Callback<void(syncer::ModelTypeSet, |
| 363 syncer::ModelTypeSet)>& ready_task, | 381 syncer::ModelTypeSet)>& ready_task, |
| 364 const base::Closure& retry_callback); | 382 const base::Closure& retry_callback); |
| 365 | 383 |
| 366 // Called when the syncer has finished performing a configuration. | 384 // Called when the syncer has finished performing a configuration. |
| 367 void FinishConfigureDataTypesOnFrontendLoop( | 385 void FinishConfigureDataTypesOnFrontendLoop( |
| 368 const syncer::ModelTypeSet enabled_types, | |
| 369 const syncer::ModelTypeSet succeeded_configuration_types, | 386 const syncer::ModelTypeSet succeeded_configuration_types, |
| 370 const syncer::ModelTypeSet failed_configuration_types, | 387 const syncer::ModelTypeSet failed_configuration_types, |
| 371 const base::Callback<void(syncer::ModelTypeSet, | 388 const base::Callback<void(syncer::ModelTypeSet, |
| 372 syncer::ModelTypeSet)>& ready_task); | 389 syncer::ModelTypeSet)>& ready_task); |
| 373 | 390 |
| 374 // Called when the SyncManager has been constructed and initialized. | 391 // Called when the SyncManager has been constructed and initialized. |
| 375 // Stores |js_backend| and |debug_info_listener| on the UI thread for | 392 // Stores |js_backend| and |debug_info_listener| on the UI thread for |
| 376 // consumption when initialization is complete. | 393 // consumption when initialization is complete. |
| 377 virtual void HandleSyncManagerInitializationOnFrontendLoop( | 394 virtual void HandleSyncManagerInitializationOnFrontendLoop( |
| 378 const syncer::WeakHandle<syncer::JsBackend>& js_backend, | 395 const syncer::WeakHandle<syncer::JsBackend>& js_backend, |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 syncer::InvalidatorState state); | 508 syncer::InvalidatorState state); |
| 492 void HandleIncomingInvalidationOnFrontendLoop( | 509 void HandleIncomingInvalidationOnFrontendLoop( |
| 493 const syncer::ObjectIdInvalidationMap& invalidation_map); | 510 const syncer::ObjectIdInvalidationMap& invalidation_map); |
| 494 | 511 |
| 495 // NotificationObserver implementation. | 512 // NotificationObserver implementation. |
| 496 virtual void Observe( | 513 virtual void Observe( |
| 497 int type, | 514 int type, |
| 498 const content::NotificationSource& source, | 515 const content::NotificationSource& source, |
| 499 const content::NotificationDetails& details) OVERRIDE; | 516 const content::NotificationDetails& details) OVERRIDE; |
| 500 | 517 |
| 501 // InvalidationHandler implementation. | |
| 502 virtual void OnInvalidatorStateChange( | |
| 503 syncer::InvalidatorState state) OVERRIDE; | |
| 504 virtual void OnIncomingInvalidation( | |
| 505 const syncer::ObjectIdInvalidationMap& invalidation_map) OVERRIDE; | |
| 506 | |
| 507 // Handles stopping the core's SyncManager, accounting for whether | 518 // Handles stopping the core's SyncManager, accounting for whether |
| 508 // initialization is done yet. | 519 // initialization is done yet. |
| 509 void StopSyncManagerForShutdown(const base::Closure& closure); | 520 void StopSyncManagerForShutdown(const base::Closure& closure); |
| 510 | 521 |
| 511 base::WeakPtrFactory<SyncBackendHost> weak_ptr_factory_; | 522 base::WeakPtrFactory<SyncBackendHost> weak_ptr_factory_; |
| 512 | 523 |
| 513 content::NotificationRegistrar notification_registrar_; | 524 content::NotificationRegistrar notification_registrar_; |
| 514 | 525 |
| 515 // A thread where all the sync operations happen. | 526 // A thread where all the sync operations happen. |
| 516 base::Thread sync_thread_; | 527 base::Thread sync_thread_; |
| 517 | 528 |
| 518 // A reference to the MessageLoop used to construct |this|, so we know how | 529 // A reference to the MessageLoop used to construct |this|, so we know how |
| 519 // to safely talk back to the SyncFrontend. | 530 // to safely talk back to the SyncFrontend. |
| 520 base::MessageLoop* const frontend_loop_; | 531 base::MessageLoop* const frontend_loop_; |
| 521 | 532 |
| 522 Profile* const profile_; | 533 Profile* const profile_; |
| 523 | 534 |
| 524 // Name used for debugging (set from profile_->GetDebugName()). | 535 // Name used for debugging (set from profile_->GetDebugName()). |
| 525 const std::string name_; | 536 const std::string name_; |
| 526 | 537 |
| 527 // Our core, which communicates directly to the syncapi. | 538 // Our core, which communicates directly to the syncapi. |
| 528 scoped_refptr<Core> core_; | 539 scoped_refptr<Core> core_; |
| 529 | 540 |
| 530 InitializationState initialization_state_; | 541 InitializationState initialization_state_; |
| 531 | 542 |
| 532 const base::WeakPtr<SyncPrefs> sync_prefs_; | 543 const base::WeakPtr<SyncPrefs> sync_prefs_; |
| 533 | 544 |
| 545 scoped_ptr<AndroidInvalidatorBridge> android_invalidator_bridge_; |
| 546 |
| 547 syncer::InvalidatorFactory invalidator_factory_; |
| 548 |
| 534 ChromeExtensionsActivityMonitor extensions_activity_monitor_; | 549 ChromeExtensionsActivityMonitor extensions_activity_monitor_; |
| 535 | 550 |
| 536 scoped_ptr<SyncBackendRegistrar> registrar_; | 551 scoped_ptr<SyncBackendRegistrar> registrar_; |
| 537 | 552 |
| 538 // The frontend which we serve (and are owned by). | 553 // The frontend which we serve (and are owned by). |
| 539 SyncFrontend* frontend_; | 554 SyncFrontend* frontend_; |
| 540 | 555 |
| 541 // We cache the cryptographer's pending keys whenever NotifyPassphraseRequired | 556 // We cache the cryptographer's pending keys whenever NotifyPassphraseRequired |
| 542 // is called. This way, before the UI calls SetDecryptionPassphrase on the | 557 // is called. This way, before the UI calls SetDecryptionPassphrase on the |
| 543 // syncer, it can avoid the overhead of an asynchronous decryption call and | 558 // syncer, it can avoid the overhead of an asynchronous decryption call and |
| (...skipping 17 matching lines...) Expand all Loading... |
| 561 // UI-thread cache of the last SyncSessionSnapshot received from syncapi. | 576 // UI-thread cache of the last SyncSessionSnapshot received from syncapi. |
| 562 syncer::sessions::SyncSessionSnapshot last_snapshot_; | 577 syncer::sessions::SyncSessionSnapshot last_snapshot_; |
| 563 | 578 |
| 564 // Temporary holder of sync manager's initialization results. Set by | 579 // Temporary holder of sync manager's initialization results. Set by |
| 565 // HandleSyncManagerInitializationOnFrontendLoop, and consumed when we pass | 580 // HandleSyncManagerInitializationOnFrontendLoop, and consumed when we pass |
| 566 // it via OnBackendInitialized in the final state of | 581 // it via OnBackendInitialized in the final state of |
| 567 // HandleInitializationCompletedOnFrontendLoop. | 582 // HandleInitializationCompletedOnFrontendLoop. |
| 568 syncer::WeakHandle<syncer::JsBackend> js_backend_; | 583 syncer::WeakHandle<syncer::JsBackend> js_backend_; |
| 569 syncer::WeakHandle<syncer::DataTypeDebugInfoListener> debug_info_listener_; | 584 syncer::WeakHandle<syncer::DataTypeDebugInfoListener> debug_info_listener_; |
| 570 | 585 |
| 571 invalidation::InvalidationService* invalidator_; | |
| 572 | |
| 573 DISALLOW_COPY_AND_ASSIGN(SyncBackendHost); | 586 DISALLOW_COPY_AND_ASSIGN(SyncBackendHost); |
| 574 }; | 587 }; |
| 575 | 588 |
| 576 } // namespace browser_sync | 589 } // namespace browser_sync |
| 577 | 590 |
| 578 #endif // CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ | 591 #endif // CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ |
| OLD | NEW |