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 CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_IMPL_H_ | 5 #ifndef CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_IMPL_H_ |
6 #define CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_IMPL_H_ | 6 #define CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_IMPL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 const DataTypeConfigStateMap& config_state_map, | 105 const DataTypeConfigStateMap& config_state_map, |
106 const base::Callback<void(syncer::ModelTypeSet, | 106 const base::Callback<void(syncer::ModelTypeSet, |
107 syncer::ModelTypeSet)>& ready_task, | 107 syncer::ModelTypeSet)>& ready_task, |
108 const base::Callback<void()>& retry_callback) OVERRIDE; | 108 const base::Callback<void()>& retry_callback) OVERRIDE; |
109 virtual void EnableEncryptEverything() OVERRIDE; | 109 virtual void EnableEncryptEverything() OVERRIDE; |
110 virtual void ActivateDataType( | 110 virtual void ActivateDataType( |
111 syncer::ModelType type, syncer::ModelSafeGroup group, | 111 syncer::ModelType type, syncer::ModelSafeGroup group, |
112 ChangeProcessor* change_processor) OVERRIDE; | 112 ChangeProcessor* change_processor) OVERRIDE; |
113 virtual void DeactivateDataType(syncer::ModelType type) OVERRIDE; | 113 virtual void DeactivateDataType(syncer::ModelType type) OVERRIDE; |
114 virtual syncer::UserShare* GetUserShare() const OVERRIDE; | 114 virtual syncer::UserShare* GetUserShare() const OVERRIDE; |
| 115 virtual syncer::SyncCoreProxy GetSyncCoreProxy() OVERRIDE; |
115 virtual Status GetDetailedStatus() OVERRIDE; | 116 virtual Status GetDetailedStatus() OVERRIDE; |
116 virtual syncer::sessions::SyncSessionSnapshot | 117 virtual syncer::sessions::SyncSessionSnapshot |
117 GetLastSessionSnapshot() const OVERRIDE; | 118 GetLastSessionSnapshot() const OVERRIDE; |
118 virtual bool HasUnsyncedItems() const OVERRIDE; | 119 virtual bool HasUnsyncedItems() const OVERRIDE; |
119 virtual bool IsNigoriEnabled() const OVERRIDE; | 120 virtual bool IsNigoriEnabled() const OVERRIDE; |
120 virtual syncer::PassphraseType GetPassphraseType() const OVERRIDE; | 121 virtual syncer::PassphraseType GetPassphraseType() const OVERRIDE; |
121 virtual base::Time GetExplicitPassphraseTime() const OVERRIDE; | 122 virtual base::Time GetExplicitPassphraseTime() const OVERRIDE; |
122 virtual bool IsCryptographerReady( | 123 virtual bool IsCryptographerReady( |
123 const syncer::BaseTransaction* trans) const OVERRIDE; | 124 const syncer::BaseTransaction* trans) const OVERRIDE; |
124 virtual void GetModelSafeRoutingInfo( | 125 virtual void GetModelSafeRoutingInfo( |
(...skipping 30 matching lines...) Expand all Loading... |
155 const syncer::ModelTypeSet succeeded_configuration_types, | 156 const syncer::ModelTypeSet succeeded_configuration_types, |
156 const syncer::ModelTypeSet failed_configuration_types, | 157 const syncer::ModelTypeSet failed_configuration_types, |
157 const base::Callback<void(syncer::ModelTypeSet, | 158 const base::Callback<void(syncer::ModelTypeSet, |
158 syncer::ModelTypeSet)>& ready_task); | 159 syncer::ModelTypeSet)>& ready_task); |
159 | 160 |
160 // Reports backend initialization success. Includes some objects from sync | 161 // Reports backend initialization success. Includes some objects from sync |
161 // manager initialization to be passed back to the UI thread. | 162 // manager initialization to be passed back to the UI thread. |
162 virtual void HandleInitializationSuccessOnFrontendLoop( | 163 virtual void HandleInitializationSuccessOnFrontendLoop( |
163 const syncer::WeakHandle<syncer::JsBackend> js_backend, | 164 const syncer::WeakHandle<syncer::JsBackend> js_backend, |
164 const syncer::WeakHandle<syncer::DataTypeDebugInfoListener> | 165 const syncer::WeakHandle<syncer::DataTypeDebugInfoListener> |
165 debug_info_listener); | 166 debug_info_listener, |
| 167 syncer::SyncCoreProxy sync_core_proxy); |
166 | 168 |
167 // Downloading of control types failed and will be retried. Invokes the | 169 // Downloading of control types failed and will be retried. Invokes the |
168 // frontend's sync configure retry method. | 170 // frontend's sync configure retry method. |
169 void HandleControlTypesDownloadRetry(); | 171 void HandleControlTypesDownloadRetry(); |
170 | 172 |
171 // Forwards a ProtocolEvent to the frontend. Will not be called unless a | 173 // Forwards a ProtocolEvent to the frontend. Will not be called unless a |
172 // call to SetForwardProtocolEvents() explicitly requested that we start | 174 // call to SetForwardProtocolEvents() explicitly requested that we start |
173 // forwarding these events. | 175 // forwarding these events. |
174 void HandleProtocolEventOnFrontendLoop(syncer::ProtocolEvent* event); | 176 void HandleProtocolEventOnFrontendLoop(syncer::ProtocolEvent* event); |
175 | 177 |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 Profile* const profile_; | 282 Profile* const profile_; |
281 | 283 |
282 // Name used for debugging (set from profile_->GetDebugName()). | 284 // Name used for debugging (set from profile_->GetDebugName()). |
283 const std::string name_; | 285 const std::string name_; |
284 | 286 |
285 // Our core, which communicates directly to the syncapi. Use refptr instead | 287 // Our core, which communicates directly to the syncapi. Use refptr instead |
286 // of WeakHandle because |core_| is created on UI loop but released on | 288 // of WeakHandle because |core_| is created on UI loop but released on |
287 // sync loop. | 289 // sync loop. |
288 scoped_refptr<SyncBackendHostCore> core_; | 290 scoped_refptr<SyncBackendHostCore> core_; |
289 | 291 |
| 292 // A handle referencing the main interface for non-blocking sync types. |
| 293 scoped_ptr<syncer::SyncCoreProxy> sync_core_proxy_; |
| 294 |
290 bool initialized_; | 295 bool initialized_; |
291 | 296 |
292 const base::WeakPtr<sync_driver::SyncPrefs> sync_prefs_; | 297 const base::WeakPtr<sync_driver::SyncPrefs> sync_prefs_; |
293 | 298 |
294 ExtensionsActivityMonitor extensions_activity_monitor_; | 299 ExtensionsActivityMonitor extensions_activity_monitor_; |
295 | 300 |
296 scoped_ptr<SyncBackendRegistrar> registrar_; | 301 scoped_ptr<SyncBackendRegistrar> registrar_; |
297 | 302 |
298 // The frontend which we serve (and are owned by). | 303 // The frontend which we serve (and are owned by). |
299 SyncFrontend* frontend_; | 304 SyncFrontend* frontend_; |
(...skipping 26 matching lines...) Expand all Loading... |
326 | 331 |
327 base::WeakPtrFactory<SyncBackendHostImpl> weak_ptr_factory_; | 332 base::WeakPtrFactory<SyncBackendHostImpl> weak_ptr_factory_; |
328 | 333 |
329 DISALLOW_COPY_AND_ASSIGN(SyncBackendHostImpl); | 334 DISALLOW_COPY_AND_ASSIGN(SyncBackendHostImpl); |
330 }; | 335 }; |
331 | 336 |
332 } // namespace browser_sync | 337 } // namespace browser_sync |
333 | 338 |
334 #endif // CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_IMPL_H_ | 339 #endif // CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_IMPL_H_ |
335 | 340 |
OLD | NEW |