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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 const std::vector<ModelSafeWorker*>& workers, | 294 const std::vector<ModelSafeWorker*>& workers, |
295 ExtensionsActivityMonitor* extensions_activity_monitor, | 295 ExtensionsActivityMonitor* extensions_activity_monitor, |
296 const WeakHandle<JsEventHandler>& event_handler, | 296 const WeakHandle<JsEventHandler>& event_handler, |
297 const GURL& service_url, | 297 const GURL& service_url, |
298 MakeHttpBridgeFactoryFn make_http_bridge_factory_fn, | 298 MakeHttpBridgeFactoryFn make_http_bridge_factory_fn, |
299 const sync_api::SyncCredentials& credentials, | 299 const sync_api::SyncCredentials& credentials, |
300 ChromeSyncNotificationBridge* chrome_sync_notification_bridge, | 300 ChromeSyncNotificationBridge* chrome_sync_notification_bridge, |
301 sync_notifier::SyncNotifierFactory* sync_notifier_factory, | 301 sync_notifier::SyncNotifierFactory* sync_notifier_factory, |
302 bool delete_sync_data_folder, | 302 bool delete_sync_data_folder, |
303 const std::string& restored_key_for_bootstrapping, | 303 const std::string& restored_key_for_bootstrapping, |
| 304 const std::string& restored_keystore_key_for_bootstrapping, |
304 sync_api::SyncManager::TestingMode testing_mode, | 305 sync_api::SyncManager::TestingMode testing_mode, |
305 UnrecoverableErrorHandler* unrecoverable_error_handler, | 306 UnrecoverableErrorHandler* unrecoverable_error_handler, |
306 ReportUnrecoverableErrorFunction report_unrecoverable_error_function); | 307 ReportUnrecoverableErrorFunction report_unrecoverable_error_function); |
307 ~DoInitializeOptions(); | 308 ~DoInitializeOptions(); |
308 | 309 |
309 MessageLoop* sync_loop; | 310 MessageLoop* sync_loop; |
310 SyncBackendRegistrar* registrar; | 311 SyncBackendRegistrar* registrar; |
311 ModelSafeRoutingInfo routing_info; | 312 ModelSafeRoutingInfo routing_info; |
312 std::vector<ModelSafeWorker*> workers; | 313 std::vector<ModelSafeWorker*> workers; |
313 ExtensionsActivityMonitor* extensions_activity_monitor; | 314 ExtensionsActivityMonitor* extensions_activity_monitor; |
314 WeakHandle<JsEventHandler> event_handler; | 315 WeakHandle<JsEventHandler> event_handler; |
315 GURL service_url; | 316 GURL service_url; |
316 // Overridden by tests. | 317 // Overridden by tests. |
317 MakeHttpBridgeFactoryFn make_http_bridge_factory_fn; | 318 MakeHttpBridgeFactoryFn make_http_bridge_factory_fn; |
318 sync_api::SyncCredentials credentials; | 319 sync_api::SyncCredentials credentials; |
319 ChromeSyncNotificationBridge* const chrome_sync_notification_bridge; | 320 ChromeSyncNotificationBridge* const chrome_sync_notification_bridge; |
320 sync_notifier::SyncNotifierFactory* const sync_notifier_factory; | 321 sync_notifier::SyncNotifierFactory* const sync_notifier_factory; |
321 std::string lsid; | 322 std::string lsid; |
322 bool delete_sync_data_folder; | 323 bool delete_sync_data_folder; |
323 std::string restored_key_for_bootstrapping; | 324 std::string restored_key_for_bootstrapping; |
| 325 std::string restored_keystore_key_for_bootstrapping; |
324 sync_api::SyncManager::TestingMode testing_mode; | 326 sync_api::SyncManager::TestingMode testing_mode; |
325 UnrecoverableErrorHandler* unrecoverable_error_handler; | 327 UnrecoverableErrorHandler* unrecoverable_error_handler; |
326 ReportUnrecoverableErrorFunction report_unrecoverable_error_function; | 328 ReportUnrecoverableErrorFunction report_unrecoverable_error_function; |
327 }; | 329 }; |
328 | 330 |
329 // Allows tests to perform alternate core initialization work. | 331 // Allows tests to perform alternate core initialization work. |
330 virtual void InitCore(const DoInitializeOptions& options); | 332 virtual void InitCore(const DoInitializeOptions& options); |
331 | 333 |
332 // Request the syncer to reconfigure with the specfied params. | 334 // Request the syncer to reconfigure with the specfied params. |
333 // Virtual for testing. | 335 // Virtual for testing. |
334 virtual void RequestConfigureSyncer( | 336 virtual void RequestConfigureSyncer( |
335 sync_api::ConfigureReason reason, | 337 sync_api::ConfigureReason reason, |
336 syncable::ModelTypeSet types_to_config, | 338 syncable::ModelTypeSet types_to_config, |
337 const browser_sync::ModelSafeRoutingInfo& routing_info, | 339 const browser_sync::ModelSafeRoutingInfo& routing_info, |
338 const base::Callback<void(syncable::ModelTypeSet)>& ready_task, | 340 const base::Callback<void(syncable::ModelTypeSet)>& ready_task, |
339 const base::Closure& retry_callback); | 341 const base::Closure& retry_callback); |
340 | 342 |
341 // Called when the syncer has finished performing a configuration. | 343 // Called when the syncer has finished performing a configuration. |
342 void FinishConfigureDataTypesOnFrontendLoop( | 344 void FinishConfigureDataTypesOnFrontendLoop( |
| 345 const std::string& keystore_bootstrap_token, |
343 const syncable::ModelTypeSet& types_to_configure, | 346 const syncable::ModelTypeSet& types_to_configure, |
344 const syncable::ModelTypeSet& configured_types, | 347 const syncable::ModelTypeSet& configured_types, |
345 const base::Callback<void(syncable::ModelTypeSet)>& ready_task); | 348 const base::Callback<void(syncable::ModelTypeSet)>& ready_task); |
346 | 349 |
347 private: | 350 private: |
348 // The real guts of SyncBackendHost, to keep the public client API clean. | 351 // The real guts of SyncBackendHost, to keep the public client API clean. |
349 class Core; | 352 class Core; |
350 | 353 |
351 // An enum representing the steps to initializing the SyncBackendHost. | 354 // An enum representing the steps to initializing the SyncBackendHost. |
352 enum InitializationState { | 355 enum InitializationState { |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 | 509 |
507 // UI-thread cache of the last SyncSessionSnapshot received from syncapi. | 510 // UI-thread cache of the last SyncSessionSnapshot received from syncapi. |
508 sessions::SyncSessionSnapshot last_snapshot_; | 511 sessions::SyncSessionSnapshot last_snapshot_; |
509 | 512 |
510 DISALLOW_COPY_AND_ASSIGN(SyncBackendHost); | 513 DISALLOW_COPY_AND_ASSIGN(SyncBackendHost); |
511 }; | 514 }; |
512 | 515 |
513 } // namespace browser_sync | 516 } // namespace browser_sync |
514 | 517 |
515 #endif // CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ | 518 #endif // CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ |
OLD | NEW |