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