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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 DoInitializeOptions( | 304 DoInitializeOptions( |
319 base::MessageLoop* sync_loop, | 305 base::MessageLoop* sync_loop, |
320 SyncBackendRegistrar* registrar, | 306 SyncBackendRegistrar* registrar, |
321 const syncer::ModelSafeRoutingInfo& routing_info, | 307 const syncer::ModelSafeRoutingInfo& routing_info, |
322 const std::vector<syncer::ModelSafeWorker*>& workers, | 308 const std::vector<syncer::ModelSafeWorker*>& workers, |
323 syncer::ExtensionsActivityMonitor* extensions_activity_monitor, | 309 syncer::ExtensionsActivityMonitor* extensions_activity_monitor, |
324 const syncer::WeakHandle<syncer::JsEventHandler>& event_handler, | 310 const syncer::WeakHandle<syncer::JsEventHandler>& event_handler, |
325 const GURL& service_url, | 311 const GURL& service_url, |
326 MakeHttpBridgeFactoryFn make_http_bridge_factory_fn, | 312 MakeHttpBridgeFactoryFn make_http_bridge_factory_fn, |
327 const syncer::SyncCredentials& credentials, | 313 const syncer::SyncCredentials& credentials, |
328 AndroidInvalidatorBridge* android_invalidator_bridge, | 314 const std::string& invalidator_client_id, |
329 syncer::InvalidatorFactory* invalidator_factory, | |
330 syncer::SyncManagerFactory* sync_manager_factory, | 315 syncer::SyncManagerFactory* sync_manager_factory, |
331 bool delete_sync_data_folder, | 316 bool delete_sync_data_folder, |
332 const std::string& restored_key_for_bootstrapping, | 317 const std::string& restored_key_for_bootstrapping, |
333 const std::string& restored_keystore_key_for_bootstrapping, | 318 const std::string& restored_keystore_key_for_bootstrapping, |
334 syncer::InternalComponentsFactory* internal_components_factory, | 319 syncer::InternalComponentsFactory* internal_components_factory, |
335 syncer::UnrecoverableErrorHandler* unrecoverable_error_handler, | 320 syncer::UnrecoverableErrorHandler* unrecoverable_error_handler, |
336 syncer::ReportUnrecoverableErrorFunction | 321 syncer::ReportUnrecoverableErrorFunction |
337 report_unrecoverable_error_function, | 322 report_unrecoverable_error_function, |
338 bool use_oauth2_token, | 323 bool use_oauth2_token); |
339 bool create_invalidator); | |
340 ~DoInitializeOptions(); | 324 ~DoInitializeOptions(); |
341 | 325 |
342 base::MessageLoop* sync_loop; | 326 base::MessageLoop* sync_loop; |
343 SyncBackendRegistrar* registrar; | 327 SyncBackendRegistrar* registrar; |
344 syncer::ModelSafeRoutingInfo routing_info; | 328 syncer::ModelSafeRoutingInfo routing_info; |
345 std::vector<syncer::ModelSafeWorker*> workers; | 329 std::vector<syncer::ModelSafeWorker*> workers; |
346 syncer::ExtensionsActivityMonitor* extensions_activity_monitor; | 330 syncer::ExtensionsActivityMonitor* extensions_activity_monitor; |
347 syncer::WeakHandle<syncer::JsEventHandler> event_handler; | 331 syncer::WeakHandle<syncer::JsEventHandler> event_handler; |
348 GURL service_url; | 332 GURL service_url; |
349 // Overridden by tests. | 333 // Overridden by tests. |
350 MakeHttpBridgeFactoryFn make_http_bridge_factory_fn; | 334 MakeHttpBridgeFactoryFn make_http_bridge_factory_fn; |
351 syncer::SyncCredentials credentials; | 335 syncer::SyncCredentials credentials; |
352 AndroidInvalidatorBridge* const android_invalidator_bridge; | 336 const std::string invalidator_client_id; |
353 syncer::InvalidatorFactory* const invalidator_factory; | |
354 syncer::SyncManagerFactory* const sync_manager_factory; | 337 syncer::SyncManagerFactory* const sync_manager_factory; |
355 std::string lsid; | 338 std::string lsid; |
356 bool delete_sync_data_folder; | 339 bool delete_sync_data_folder; |
357 std::string restored_key_for_bootstrapping; | 340 std::string restored_key_for_bootstrapping; |
358 std::string restored_keystore_key_for_bootstrapping; | 341 std::string restored_keystore_key_for_bootstrapping; |
359 syncer::InternalComponentsFactory* internal_components_factory; | 342 syncer::InternalComponentsFactory* internal_components_factory; |
360 syncer::UnrecoverableErrorHandler* unrecoverable_error_handler; | 343 syncer::UnrecoverableErrorHandler* unrecoverable_error_handler; |
361 syncer::ReportUnrecoverableErrorFunction | 344 syncer::ReportUnrecoverableErrorFunction |
362 report_unrecoverable_error_function; | 345 report_unrecoverable_error_function; |
363 bool use_oauth2_token; | 346 bool use_oauth2_token; |
364 bool create_invalidator; | |
365 }; | 347 }; |
366 | 348 |
367 // Allows tests to perform alternate core initialization work. | 349 // Allows tests to perform alternate core initialization work. |
368 virtual void InitCore(const DoInitializeOptions& options); | 350 virtual void InitCore(const DoInitializeOptions& options); |
369 | 351 |
370 // Request the syncer to reconfigure with the specfied params. | 352 // Request the syncer to reconfigure with the specfied params. |
371 // Virtual for testing. | 353 // Virtual for testing. |
372 virtual void RequestConfigureSyncer( | 354 virtual void RequestConfigureSyncer( |
373 syncer::ConfigureReason reason, | 355 syncer::ConfigureReason reason, |
374 syncer::ModelTypeSet to_download, | 356 syncer::ModelTypeSet to_download, |
375 syncer::ModelTypeSet to_purge, | 357 syncer::ModelTypeSet to_purge, |
376 syncer::ModelTypeSet to_journal, | 358 syncer::ModelTypeSet to_journal, |
377 syncer::ModelTypeSet to_unapply, | 359 syncer::ModelTypeSet to_unapply, |
378 syncer::ModelTypeSet to_ignore, | 360 syncer::ModelTypeSet to_ignore, |
379 const syncer::ModelSafeRoutingInfo& routing_info, | 361 const syncer::ModelSafeRoutingInfo& routing_info, |
380 const base::Callback<void(syncer::ModelTypeSet, | 362 const base::Callback<void(syncer::ModelTypeSet, |
381 syncer::ModelTypeSet)>& ready_task, | 363 syncer::ModelTypeSet)>& ready_task, |
382 const base::Closure& retry_callback); | 364 const base::Closure& retry_callback); |
383 | 365 |
384 // Called when the syncer has finished performing a configuration. | 366 // Called when the syncer has finished performing a configuration. |
385 void FinishConfigureDataTypesOnFrontendLoop( | 367 void FinishConfigureDataTypesOnFrontendLoop( |
| 368 const syncer::ModelTypeSet enabled_types, |
386 const syncer::ModelTypeSet succeeded_configuration_types, | 369 const syncer::ModelTypeSet succeeded_configuration_types, |
387 const syncer::ModelTypeSet failed_configuration_types, | 370 const syncer::ModelTypeSet failed_configuration_types, |
388 const base::Callback<void(syncer::ModelTypeSet, | 371 const base::Callback<void(syncer::ModelTypeSet, |
389 syncer::ModelTypeSet)>& ready_task); | 372 syncer::ModelTypeSet)>& ready_task); |
390 | 373 |
391 // Called when the SyncManager has been constructed and initialized. | 374 // Called when the SyncManager has been constructed and initialized. |
392 // Stores |js_backend| and |debug_info_listener| on the UI thread for | 375 // Stores |js_backend| and |debug_info_listener| on the UI thread for |
393 // consumption when initialization is complete. | 376 // consumption when initialization is complete. |
394 virtual void HandleSyncManagerInitializationOnFrontendLoop( | 377 virtual void HandleSyncManagerInitializationOnFrontendLoop( |
395 const syncer::WeakHandle<syncer::JsBackend>& js_backend, | 378 const syncer::WeakHandle<syncer::JsBackend>& js_backend, |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 syncer::InvalidatorState state); | 491 syncer::InvalidatorState state); |
509 void HandleIncomingInvalidationOnFrontendLoop( | 492 void HandleIncomingInvalidationOnFrontendLoop( |
510 const syncer::ObjectIdInvalidationMap& invalidation_map); | 493 const syncer::ObjectIdInvalidationMap& invalidation_map); |
511 | 494 |
512 // NotificationObserver implementation. | 495 // NotificationObserver implementation. |
513 virtual void Observe( | 496 virtual void Observe( |
514 int type, | 497 int type, |
515 const content::NotificationSource& source, | 498 const content::NotificationSource& source, |
516 const content::NotificationDetails& details) OVERRIDE; | 499 const content::NotificationDetails& details) OVERRIDE; |
517 | 500 |
| 501 // InvalidationHandler implementation. |
| 502 virtual void OnInvalidatorStateChange( |
| 503 syncer::InvalidatorState state) OVERRIDE; |
| 504 virtual void OnIncomingInvalidation( |
| 505 const syncer::ObjectIdInvalidationMap& invalidation_map) OVERRIDE; |
| 506 |
518 // Handles stopping the core's SyncManager, accounting for whether | 507 // Handles stopping the core's SyncManager, accounting for whether |
519 // initialization is done yet. | 508 // initialization is done yet. |
520 void StopSyncManagerForShutdown(const base::Closure& closure); | 509 void StopSyncManagerForShutdown(const base::Closure& closure); |
521 | 510 |
522 base::WeakPtrFactory<SyncBackendHost> weak_ptr_factory_; | 511 base::WeakPtrFactory<SyncBackendHost> weak_ptr_factory_; |
523 | 512 |
524 content::NotificationRegistrar notification_registrar_; | 513 content::NotificationRegistrar notification_registrar_; |
525 | 514 |
526 // A thread where all the sync operations happen. | 515 // A thread where all the sync operations happen. |
527 base::Thread sync_thread_; | 516 base::Thread sync_thread_; |
528 | 517 |
529 // A reference to the MessageLoop used to construct |this|, so we know how | 518 // A reference to the MessageLoop used to construct |this|, so we know how |
530 // to safely talk back to the SyncFrontend. | 519 // to safely talk back to the SyncFrontend. |
531 base::MessageLoop* const frontend_loop_; | 520 base::MessageLoop* const frontend_loop_; |
532 | 521 |
533 Profile* const profile_; | 522 Profile* const profile_; |
534 | 523 |
535 // Name used for debugging (set from profile_->GetDebugName()). | 524 // Name used for debugging (set from profile_->GetDebugName()). |
536 const std::string name_; | 525 const std::string name_; |
537 | 526 |
538 // Our core, which communicates directly to the syncapi. | 527 // Our core, which communicates directly to the syncapi. |
539 scoped_refptr<Core> core_; | 528 scoped_refptr<Core> core_; |
540 | 529 |
541 InitializationState initialization_state_; | 530 InitializationState initialization_state_; |
542 | 531 |
543 const base::WeakPtr<SyncPrefs> sync_prefs_; | 532 const base::WeakPtr<SyncPrefs> sync_prefs_; |
544 | 533 |
545 scoped_ptr<AndroidInvalidatorBridge> android_invalidator_bridge_; | |
546 | |
547 syncer::InvalidatorFactory invalidator_factory_; | |
548 | |
549 ChromeExtensionsActivityMonitor extensions_activity_monitor_; | 534 ChromeExtensionsActivityMonitor extensions_activity_monitor_; |
550 | 535 |
551 scoped_ptr<SyncBackendRegistrar> registrar_; | 536 scoped_ptr<SyncBackendRegistrar> registrar_; |
552 | 537 |
553 // The frontend which we serve (and are owned by). | 538 // The frontend which we serve (and are owned by). |
554 SyncFrontend* frontend_; | 539 SyncFrontend* frontend_; |
555 | 540 |
556 // We cache the cryptographer's pending keys whenever NotifyPassphraseRequired | 541 // We cache the cryptographer's pending keys whenever NotifyPassphraseRequired |
557 // is called. This way, before the UI calls SetDecryptionPassphrase on the | 542 // is called. This way, before the UI calls SetDecryptionPassphrase on the |
558 // syncer, it can avoid the overhead of an asynchronous decryption call and | 543 // syncer, it can avoid the overhead of an asynchronous decryption call and |
(...skipping 17 matching lines...) Expand all Loading... |
576 // UI-thread cache of the last SyncSessionSnapshot received from syncapi. | 561 // UI-thread cache of the last SyncSessionSnapshot received from syncapi. |
577 syncer::sessions::SyncSessionSnapshot last_snapshot_; | 562 syncer::sessions::SyncSessionSnapshot last_snapshot_; |
578 | 563 |
579 // Temporary holder of sync manager's initialization results. Set by | 564 // Temporary holder of sync manager's initialization results. Set by |
580 // HandleSyncManagerInitializationOnFrontendLoop, and consumed when we pass | 565 // HandleSyncManagerInitializationOnFrontendLoop, and consumed when we pass |
581 // it via OnBackendInitialized in the final state of | 566 // it via OnBackendInitialized in the final state of |
582 // HandleInitializationCompletedOnFrontendLoop. | 567 // HandleInitializationCompletedOnFrontendLoop. |
583 syncer::WeakHandle<syncer::JsBackend> js_backend_; | 568 syncer::WeakHandle<syncer::JsBackend> js_backend_; |
584 syncer::WeakHandle<syncer::DataTypeDebugInfoListener> debug_info_listener_; | 569 syncer::WeakHandle<syncer::DataTypeDebugInfoListener> debug_info_listener_; |
585 | 570 |
| 571 invalidation::InvalidationService* invalidator_; |
| 572 |
586 DISALLOW_COPY_AND_ASSIGN(SyncBackendHost); | 573 DISALLOW_COPY_AND_ASSIGN(SyncBackendHost); |
587 }; | 574 }; |
588 | 575 |
589 } // namespace browser_sync | 576 } // namespace browser_sync |
590 | 577 |
591 #endif // CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ | 578 #endif // CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ |
OLD | NEW |