| 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_IMPL_H_ | 5 #ifndef COMPONENTS_SYNC_DRIVER_GLUE_SYNC_BACKEND_HOST_IMPL_H_ |
| 6 #define COMPONENTS_SYNC_DRIVER_GLUE_SYNC_BACKEND_HOST_IMPL_H_ | 6 #define COMPONENTS_SYNC_DRIVER_GLUE_SYNC_BACKEND_HOST_IMPL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| 11 #include <memory> | 11 #include <memory> |
| 12 #include <string> | 12 #include <string> |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "base/callback.h" | 15 #include "base/callback.h" |
| 16 #include "base/compiler_specific.h" | 16 #include "base/compiler_specific.h" |
| 17 #include "base/macros.h" | 17 #include "base/macros.h" |
| 18 #include "base/memory/ref_counted.h" |
| 18 #include "base/memory/weak_ptr.h" | 19 #include "base/memory/weak_ptr.h" |
| 20 #include "base/single_thread_task_runner.h" |
| 19 #include "base/threading/thread.h" | 21 #include "base/threading/thread.h" |
| 20 #include "components/invalidation/public/invalidation_handler.h" | 22 #include "components/invalidation/public/invalidation_handler.h" |
| 21 #include "components/sync_driver/backend_data_type_configurer.h" | 23 #include "components/sync_driver/backend_data_type_configurer.h" |
| 22 #include "components/sync_driver/glue/sync_backend_host.h" | 24 #include "components/sync_driver/glue/sync_backend_host.h" |
| 23 #include "sync/internal_api/public/base/model_type.h" | 25 #include "sync/internal_api/public/base/model_type.h" |
| 24 #include "sync/internal_api/public/configure_reason.h" | 26 #include "sync/internal_api/public/configure_reason.h" |
| 25 #include "sync/internal_api/public/sessions/sync_session_snapshot.h" | 27 #include "sync/internal_api/public/sessions/sync_session_snapshot.h" |
| 26 #include "sync/internal_api/public/sessions/type_debug_info_observer.h" | 28 #include "sync/internal_api/public/sessions/type_debug_info_observer.h" |
| 27 #include "sync/internal_api/public/sync_manager.h" | 29 #include "sync/internal_api/public/sync_manager.h" |
| 28 #include "sync/internal_api/public/util/weak_handle.h" | 30 #include "sync/internal_api/public/util/weak_handle.h" |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 const syncer::SyncEncryptionHandler::NigoriState& nigori_state); | 313 const syncer::SyncEncryptionHandler::NigoriState& nigori_state); |
| 312 | 314 |
| 313 // Dispatched to from OnConnectionStatusChange to handle updating | 315 // Dispatched to from OnConnectionStatusChange to handle updating |
| 314 // frontend UI components. | 316 // frontend UI components. |
| 315 void HandleConnectionStatusChangeOnFrontendLoop( | 317 void HandleConnectionStatusChangeOnFrontendLoop( |
| 316 syncer::ConnectionStatus status); | 318 syncer::ConnectionStatus status); |
| 317 | 319 |
| 318 void ClearServerDataDoneOnFrontendLoop( | 320 void ClearServerDataDoneOnFrontendLoop( |
| 319 const syncer::SyncManager::ClearServerDataCallback& frontend_callback); | 321 const syncer::SyncManager::ClearServerDataCallback& frontend_callback); |
| 320 | 322 |
| 321 // A reference to the MessageLoop used to construct |this|, so we know how | 323 // A reference to the TaskRUnner used to construct |this|, so we know how to |
| 322 // to safely talk back to the SyncFrontend. | 324 // safely talk back to the SyncFrontend. |
| 323 base::MessageLoop* const frontend_loop_; | 325 scoped_refptr<base::SingleThreadTaskRunner> const frontend_task_runner_; |
| 324 | 326 |
| 325 sync_driver::SyncClient* const sync_client_; | 327 sync_driver::SyncClient* const sync_client_; |
| 326 | 328 |
| 327 // The UI thread's task runner. | 329 // The UI thread's task runner. |
| 328 const scoped_refptr<base::SingleThreadTaskRunner> ui_thread_; | 330 const scoped_refptr<base::SingleThreadTaskRunner> ui_thread_; |
| 329 | 331 |
| 330 // Name used for debugging (set from profile_->GetDebugName()). | 332 // Name used for debugging (set from profile_->GetDebugName()). |
| 331 const std::string name_; | 333 const std::string name_; |
| 332 | 334 |
| 333 // Our core, which communicates directly to the syncapi. Use refptr instead | 335 // Our core, which communicates directly to the syncapi. Use refptr instead |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 bool invalidation_handler_registered_; | 377 bool invalidation_handler_registered_; |
| 376 | 378 |
| 377 base::WeakPtrFactory<SyncBackendHostImpl> weak_ptr_factory_; | 379 base::WeakPtrFactory<SyncBackendHostImpl> weak_ptr_factory_; |
| 378 | 380 |
| 379 DISALLOW_COPY_AND_ASSIGN(SyncBackendHostImpl); | 381 DISALLOW_COPY_AND_ASSIGN(SyncBackendHostImpl); |
| 380 }; | 382 }; |
| 381 | 383 |
| 382 } // namespace browser_sync | 384 } // namespace browser_sync |
| 383 | 385 |
| 384 #endif // COMPONENTS_SYNC_DRIVER_GLUE_SYNC_BACKEND_HOST_IMPL_H_ | 386 #endif // COMPONENTS_SYNC_DRIVER_GLUE_SYNC_BACKEND_HOST_IMPL_H_ |
| OLD | NEW |