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