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" |
(...skipping 16 matching lines...) Expand all Loading... |
27 #include "sync/internal_api/public/sync_encryption_handler.h" | 27 #include "sync/internal_api/public/sync_encryption_handler.h" |
28 #include "sync/internal_api/public/sync_manager.h" | 28 #include "sync/internal_api/public/sync_manager.h" |
29 #include "sync/internal_api/public/util/report_unrecoverable_error_function.h" | 29 #include "sync/internal_api/public/util/report_unrecoverable_error_function.h" |
30 #include "sync/internal_api/public/util/unrecoverable_error_handler.h" | 30 #include "sync/internal_api/public/util/unrecoverable_error_handler.h" |
31 #include "sync/internal_api/public/util/weak_handle.h" | 31 #include "sync/internal_api/public/util/weak_handle.h" |
32 #include "sync/notifier/invalidation_handler.h" | 32 #include "sync/notifier/invalidation_handler.h" |
33 #include "sync/notifier/invalidator_factory.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; |
| 38 |
| 39 namespace base { |
37 class MessageLoop; | 40 class MessageLoop; |
38 class Profile; | 41 } |
39 | 42 |
40 namespace syncer { | 43 namespace syncer { |
41 class SyncManagerFactory; | 44 class SyncManagerFactory; |
42 } | 45 } |
43 | 46 |
44 namespace browser_sync { | 47 namespace browser_sync { |
45 | 48 |
46 class AndroidInvalidatorBridge; | 49 class AndroidInvalidatorBridge; |
47 class ChangeProcessor; | 50 class ChangeProcessor; |
48 class InvalidatorStorage; | 51 class InvalidatorStorage; |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 // subclasses can use them. | 303 // subclasses can use them. |
301 // | 304 // |
302 // TODO(akalin): Figure out a better way for tests to hook into | 305 // TODO(akalin): Figure out a better way for tests to hook into |
303 // SyncBackendHost. | 306 // SyncBackendHost. |
304 | 307 |
305 typedef base::Callback<scoped_ptr<syncer::HttpPostProviderFactory>(void)> | 308 typedef base::Callback<scoped_ptr<syncer::HttpPostProviderFactory>(void)> |
306 MakeHttpBridgeFactoryFn; | 309 MakeHttpBridgeFactoryFn; |
307 | 310 |
308 struct DoInitializeOptions { | 311 struct DoInitializeOptions { |
309 DoInitializeOptions( | 312 DoInitializeOptions( |
310 MessageLoop* sync_loop, | 313 base::MessageLoop* sync_loop, |
311 SyncBackendRegistrar* registrar, | 314 SyncBackendRegistrar* registrar, |
312 const syncer::ModelSafeRoutingInfo& routing_info, | 315 const syncer::ModelSafeRoutingInfo& routing_info, |
313 const std::vector<syncer::ModelSafeWorker*>& workers, | 316 const std::vector<syncer::ModelSafeWorker*>& workers, |
314 syncer::ExtensionsActivityMonitor* extensions_activity_monitor, | 317 syncer::ExtensionsActivityMonitor* extensions_activity_monitor, |
315 const syncer::WeakHandle<syncer::JsEventHandler>& event_handler, | 318 const syncer::WeakHandle<syncer::JsEventHandler>& event_handler, |
316 const GURL& service_url, | 319 const GURL& service_url, |
317 MakeHttpBridgeFactoryFn make_http_bridge_factory_fn, | 320 MakeHttpBridgeFactoryFn make_http_bridge_factory_fn, |
318 const syncer::SyncCredentials& credentials, | 321 const syncer::SyncCredentials& credentials, |
319 AndroidInvalidatorBridge* android_invalidator_bridge, | 322 AndroidInvalidatorBridge* android_invalidator_bridge, |
320 syncer::InvalidatorFactory* invalidator_factory, | 323 syncer::InvalidatorFactory* invalidator_factory, |
321 syncer::SyncManagerFactory* sync_manager_factory, | 324 syncer::SyncManagerFactory* sync_manager_factory, |
322 bool delete_sync_data_folder, | 325 bool delete_sync_data_folder, |
323 const std::string& restored_key_for_bootstrapping, | 326 const std::string& restored_key_for_bootstrapping, |
324 const std::string& restored_keystore_key_for_bootstrapping, | 327 const std::string& restored_keystore_key_for_bootstrapping, |
325 syncer::InternalComponentsFactory* internal_components_factory, | 328 syncer::InternalComponentsFactory* internal_components_factory, |
326 syncer::UnrecoverableErrorHandler* unrecoverable_error_handler, | 329 syncer::UnrecoverableErrorHandler* unrecoverable_error_handler, |
327 syncer::ReportUnrecoverableErrorFunction | 330 syncer::ReportUnrecoverableErrorFunction |
328 report_unrecoverable_error_function); | 331 report_unrecoverable_error_function); |
329 ~DoInitializeOptions(); | 332 ~DoInitializeOptions(); |
330 | 333 |
331 MessageLoop* sync_loop; | 334 base::MessageLoop* sync_loop; |
332 SyncBackendRegistrar* registrar; | 335 SyncBackendRegistrar* registrar; |
333 syncer::ModelSafeRoutingInfo routing_info; | 336 syncer::ModelSafeRoutingInfo routing_info; |
334 std::vector<syncer::ModelSafeWorker*> workers; | 337 std::vector<syncer::ModelSafeWorker*> workers; |
335 syncer::ExtensionsActivityMonitor* extensions_activity_monitor; | 338 syncer::ExtensionsActivityMonitor* extensions_activity_monitor; |
336 syncer::WeakHandle<syncer::JsEventHandler> event_handler; | 339 syncer::WeakHandle<syncer::JsEventHandler> event_handler; |
337 GURL service_url; | 340 GURL service_url; |
338 // Overridden by tests. | 341 // Overridden by tests. |
339 MakeHttpBridgeFactoryFn make_http_bridge_factory_fn; | 342 MakeHttpBridgeFactoryFn make_http_bridge_factory_fn; |
340 syncer::SyncCredentials credentials; | 343 syncer::SyncCredentials credentials; |
341 AndroidInvalidatorBridge* const android_invalidator_bridge; | 344 AndroidInvalidatorBridge* const android_invalidator_bridge; |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 | 505 |
503 base::WeakPtrFactory<SyncBackendHost> weak_ptr_factory_; | 506 base::WeakPtrFactory<SyncBackendHost> weak_ptr_factory_; |
504 | 507 |
505 content::NotificationRegistrar notification_registrar_; | 508 content::NotificationRegistrar notification_registrar_; |
506 | 509 |
507 // A thread where all the sync operations happen. | 510 // A thread where all the sync operations happen. |
508 base::Thread sync_thread_; | 511 base::Thread sync_thread_; |
509 | 512 |
510 // A reference to the MessageLoop used to construct |this|, so we know how | 513 // A reference to the MessageLoop used to construct |this|, so we know how |
511 // to safely talk back to the SyncFrontend. | 514 // to safely talk back to the SyncFrontend. |
512 MessageLoop* const frontend_loop_; | 515 base::MessageLoop* const frontend_loop_; |
513 | 516 |
514 Profile* const profile_; | 517 Profile* const profile_; |
515 | 518 |
516 // Name used for debugging (set from profile_->GetDebugName()). | 519 // Name used for debugging (set from profile_->GetDebugName()). |
517 const std::string name_; | 520 const std::string name_; |
518 | 521 |
519 // Our core, which communicates directly to the syncapi. | 522 // Our core, which communicates directly to the syncapi. |
520 scoped_refptr<Core> core_; | 523 scoped_refptr<Core> core_; |
521 | 524 |
522 InitializationState initialization_state_; | 525 InitializationState initialization_state_; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 // HandleInitializationCompletedOnFrontendLoop. | 566 // HandleInitializationCompletedOnFrontendLoop. |
564 syncer::WeakHandle<syncer::JsBackend> js_backend_; | 567 syncer::WeakHandle<syncer::JsBackend> js_backend_; |
565 syncer::WeakHandle<syncer::DataTypeDebugInfoListener> debug_info_listener_; | 568 syncer::WeakHandle<syncer::DataTypeDebugInfoListener> debug_info_listener_; |
566 | 569 |
567 DISALLOW_COPY_AND_ASSIGN(SyncBackendHost); | 570 DISALLOW_COPY_AND_ASSIGN(SyncBackendHost); |
568 }; | 571 }; |
569 | 572 |
570 } // namespace browser_sync | 573 } // namespace browser_sync |
571 | 574 |
572 #endif // CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ | 575 #endif // CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ |
OLD | NEW |