OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 COMPONENTS_SYNC_DRIVER_GLUE_SYNC_BACKEND_HOST_CORE_H_ | 5 #ifndef COMPONENTS_SYNC_DRIVER_GLUE_SYNC_BACKEND_HOST_CORE_H_ |
6 #define COMPONENTS_SYNC_DRIVER_GLUE_SYNC_BACKEND_HOST_CORE_H_ | 6 #define COMPONENTS_SYNC_DRIVER_GLUE_SYNC_BACKEND_HOST_CORE_H_ |
7 | 7 |
| 8 #include <stdint.h> |
| 9 |
8 #include "base/macros.h" | 10 #include "base/macros.h" |
9 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
10 #include "base/timer/timer.h" | 12 #include "base/timer/timer.h" |
11 #include "components/invalidation/public/invalidation.h" | 13 #include "components/invalidation/public/invalidation.h" |
12 #include "components/sync_driver/glue/sync_backend_host_impl.h" | 14 #include "components/sync_driver/glue/sync_backend_host_impl.h" |
13 #include "components/sync_driver/system_encryptor.h" | 15 #include "components/sync_driver/system_encryptor.h" |
14 #include "sync/internal_api/public/base/cancelation_signal.h" | 16 #include "sync/internal_api/public/base/cancelation_signal.h" |
15 #include "sync/internal_api/public/sessions/type_debug_info_observer.h" | 17 #include "sync/internal_api/public/sessions/type_debug_info_observer.h" |
16 #include "sync/internal_api/public/shutdown_reason.h" | 18 #include "sync/internal_api/public/shutdown_reason.h" |
17 #include "sync/internal_api/public/sync_encryption_handler.h" | 19 #include "sync/internal_api/public/sync_encryption_handler.h" |
(...skipping 20 matching lines...) Expand all Loading... |
38 scoped_ptr<syncer::SyncManagerFactory> sync_manager_factory, | 40 scoped_ptr<syncer::SyncManagerFactory> sync_manager_factory, |
39 bool delete_sync_data_folder, | 41 bool delete_sync_data_folder, |
40 const std::string& restored_key_for_bootstrapping, | 42 const std::string& restored_key_for_bootstrapping, |
41 const std::string& restored_keystore_key_for_bootstrapping, | 43 const std::string& restored_keystore_key_for_bootstrapping, |
42 scoped_ptr<syncer::InternalComponentsFactory> internal_components_factory, | 44 scoped_ptr<syncer::InternalComponentsFactory> internal_components_factory, |
43 const syncer::WeakHandle<syncer::UnrecoverableErrorHandler>& | 45 const syncer::WeakHandle<syncer::UnrecoverableErrorHandler>& |
44 unrecoverable_error_handler, | 46 unrecoverable_error_handler, |
45 const base::Closure& report_unrecoverable_error_function, | 47 const base::Closure& report_unrecoverable_error_function, |
46 scoped_ptr<syncer::SyncEncryptionHandler::NigoriState> saved_nigori_state, | 48 scoped_ptr<syncer::SyncEncryptionHandler::NigoriState> saved_nigori_state, |
47 syncer::PassphraseTransitionClearDataOption clear_data_option, | 49 syncer::PassphraseTransitionClearDataOption clear_data_option, |
48 const std::map<syncer::ModelType, int64>& invalidation_versions); | 50 const std::map<syncer::ModelType, int64_t>& invalidation_versions); |
49 ~DoInitializeOptions(); | 51 ~DoInitializeOptions(); |
50 | 52 |
51 base::MessageLoop* sync_loop; | 53 base::MessageLoop* sync_loop; |
52 SyncBackendRegistrar* registrar; | 54 SyncBackendRegistrar* registrar; |
53 syncer::ModelSafeRoutingInfo routing_info; | 55 syncer::ModelSafeRoutingInfo routing_info; |
54 std::vector<scoped_refptr<syncer::ModelSafeWorker> > workers; | 56 std::vector<scoped_refptr<syncer::ModelSafeWorker> > workers; |
55 scoped_refptr<syncer::ExtensionsActivity> extensions_activity; | 57 scoped_refptr<syncer::ExtensionsActivity> extensions_activity; |
56 syncer::WeakHandle<syncer::JsEventHandler> event_handler; | 58 syncer::WeakHandle<syncer::JsEventHandler> event_handler; |
57 GURL service_url; | 59 GURL service_url; |
58 std::string sync_user_agent; | 60 std::string sync_user_agent; |
59 // Overridden by tests. | 61 // Overridden by tests. |
60 scoped_ptr<syncer::HttpPostProviderFactory> http_bridge_factory; | 62 scoped_ptr<syncer::HttpPostProviderFactory> http_bridge_factory; |
61 syncer::SyncCredentials credentials; | 63 syncer::SyncCredentials credentials; |
62 const std::string invalidator_client_id; | 64 const std::string invalidator_client_id; |
63 scoped_ptr<syncer::SyncManagerFactory> sync_manager_factory; | 65 scoped_ptr<syncer::SyncManagerFactory> sync_manager_factory; |
64 std::string lsid; | 66 std::string lsid; |
65 bool delete_sync_data_folder; | 67 bool delete_sync_data_folder; |
66 std::string restored_key_for_bootstrapping; | 68 std::string restored_key_for_bootstrapping; |
67 std::string restored_keystore_key_for_bootstrapping; | 69 std::string restored_keystore_key_for_bootstrapping; |
68 scoped_ptr<syncer::InternalComponentsFactory> internal_components_factory; | 70 scoped_ptr<syncer::InternalComponentsFactory> internal_components_factory; |
69 const syncer::WeakHandle<syncer::UnrecoverableErrorHandler> | 71 const syncer::WeakHandle<syncer::UnrecoverableErrorHandler> |
70 unrecoverable_error_handler; | 72 unrecoverable_error_handler; |
71 base::Closure report_unrecoverable_error_function; | 73 base::Closure report_unrecoverable_error_function; |
72 scoped_ptr<syncer::SyncEncryptionHandler::NigoriState> saved_nigori_state; | 74 scoped_ptr<syncer::SyncEncryptionHandler::NigoriState> saved_nigori_state; |
73 const syncer::PassphraseTransitionClearDataOption clear_data_option; | 75 const syncer::PassphraseTransitionClearDataOption clear_data_option; |
74 const std::map<syncer::ModelType, int64> invalidation_versions; | 76 const std::map<syncer::ModelType, int64_t> invalidation_versions; |
75 }; | 77 }; |
76 | 78 |
77 // Helper struct to handle currying params to | 79 // Helper struct to handle currying params to |
78 // SyncBackendHost::Core::DoConfigureSyncer. | 80 // SyncBackendHost::Core::DoConfigureSyncer. |
79 struct DoConfigureSyncerTypes { | 81 struct DoConfigureSyncerTypes { |
80 DoConfigureSyncerTypes(); | 82 DoConfigureSyncerTypes(); |
81 ~DoConfigureSyncerTypes(); | 83 ~DoConfigureSyncerTypes(); |
82 syncer::ModelTypeSet to_download; | 84 syncer::ModelTypeSet to_download; |
83 syncer::ModelTypeSet to_purge; | 85 syncer::ModelTypeSet to_purge; |
84 syncer::ModelTypeSet to_journal; | 86 syncer::ModelTypeSet to_journal; |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 // Set when we've been asked to forward sync protocol events to the frontend. | 315 // Set when we've been asked to forward sync protocol events to the frontend. |
314 bool forward_protocol_events_; | 316 bool forward_protocol_events_; |
315 | 317 |
316 // Set when the forwarding of per-type debug counters is enabled. | 318 // Set when the forwarding of per-type debug counters is enabled. |
317 bool forward_type_info_; | 319 bool forward_type_info_; |
318 | 320 |
319 // A map of data type -> invalidation version to track the most recently | 321 // A map of data type -> invalidation version to track the most recently |
320 // received invalidation version for each type. | 322 // received invalidation version for each type. |
321 // This allows dropping any invalidations with versions older than those | 323 // This allows dropping any invalidations with versions older than those |
322 // most recently received for that data type. | 324 // most recently received for that data type. |
323 std::map<syncer::ModelType, int64> last_invalidation_versions_; | 325 std::map<syncer::ModelType, int64_t> last_invalidation_versions_; |
324 | 326 |
325 base::WeakPtrFactory<SyncBackendHostCore> weak_ptr_factory_; | 327 base::WeakPtrFactory<SyncBackendHostCore> weak_ptr_factory_; |
326 | 328 |
327 DISALLOW_COPY_AND_ASSIGN(SyncBackendHostCore); | 329 DISALLOW_COPY_AND_ASSIGN(SyncBackendHostCore); |
328 }; | 330 }; |
329 | 331 |
330 } // namespace browser_sync | 332 } // namespace browser_sync |
331 | 333 |
332 #endif // COMPONENTS_SYNC_DRIVER_GLUE_SYNC_BACKEND_HOST_CORE_H_ | 334 #endif // COMPONENTS_SYNC_DRIVER_GLUE_SYNC_BACKEND_HOST_CORE_H_ |
OLD | NEW |