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 #include "components/sync/driver/glue/sync_backend_host_impl.h" | 5 #include "components/sync/driver/glue/sync_backend_host_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/feature_list.h" | 10 #include "base/feature_list.h" |
11 #include "base/location.h" | 11 #include "base/location.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/memory/ptr_util.h" |
13 #include "base/threading/thread_task_runner_handle.h" | 14 #include "base/threading/thread_task_runner_handle.h" |
14 #include "components/invalidation/public/invalidation_service.h" | 15 #include "components/invalidation/public/invalidation_service.h" |
15 #include "components/invalidation/public/object_id_invalidation_map.h" | 16 #include "components/invalidation/public/object_id_invalidation_map.h" |
16 #include "components/signin/core/browser/signin_client.h" | 17 #include "components/signin/core/browser/signin_client.h" |
17 #include "components/sync/base/experiments.h" | 18 #include "components/sync/base/experiments.h" |
18 #include "components/sync/base/invalidation_helper.h" | 19 #include "components/sync/base/invalidation_helper.h" |
19 #include "components/sync/base/sync_prefs.h" | 20 #include "components/sync/base/sync_prefs.h" |
20 #include "components/sync/driver/glue/sync_backend_host_core.h" | 21 #include "components/sync/driver/glue/sync_backend_host_core.h" |
21 #include "components/sync/driver/glue/sync_backend_registrar.h" | 22 #include "components/sync/driver/glue/sync_backend_registrar.h" |
22 #include "components/sync/driver/sync_client.h" | 23 #include "components/sync/driver/sync_client.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 const WeakHandle<JsEventHandler>& event_handler, | 77 const WeakHandle<JsEventHandler>& event_handler, |
77 const GURL& sync_service_url, | 78 const GURL& sync_service_url, |
78 const std::string& sync_user_agent, | 79 const std::string& sync_user_agent, |
79 const SyncCredentials& credentials, | 80 const SyncCredentials& credentials, |
80 bool delete_sync_data_folder, | 81 bool delete_sync_data_folder, |
81 std::unique_ptr<SyncManagerFactory> sync_manager_factory, | 82 std::unique_ptr<SyncManagerFactory> sync_manager_factory, |
82 const WeakHandle<UnrecoverableErrorHandler>& unrecoverable_error_handler, | 83 const WeakHandle<UnrecoverableErrorHandler>& unrecoverable_error_handler, |
83 const base::Closure& report_unrecoverable_error_function, | 84 const base::Closure& report_unrecoverable_error_function, |
84 const HttpPostProviderFactoryGetter& http_post_provider_factory_getter, | 85 const HttpPostProviderFactoryGetter& http_post_provider_factory_getter, |
85 std::unique_ptr<SyncEncryptionHandler::NigoriState> saved_nigori_state) { | 86 std::unique_ptr<SyncEncryptionHandler::NigoriState> saved_nigori_state) { |
86 registrar_.reset(new SyncBackendRegistrar(name_, sync_client_, | 87 registrar_ = base::MakeUnique<SyncBackendRegistrar>( |
87 std::move(sync_thread), ui_thread_, | 88 name_, sync_client_, std::move(sync_thread), ui_thread_, db_thread, |
88 db_thread, file_thread)); | 89 file_thread); |
89 CHECK(registrar_->sync_thread()); | 90 CHECK(registrar_->sync_thread()); |
90 | 91 |
91 frontend_ = frontend; | 92 frontend_ = frontend; |
92 DCHECK(frontend); | 93 DCHECK(frontend); |
93 | 94 |
94 std::vector<scoped_refptr<ModelSafeWorker>> workers; | 95 std::vector<scoped_refptr<ModelSafeWorker>> workers; |
95 registrar_->GetWorkers(&workers); | 96 registrar_->GetWorkers(&workers); |
96 | 97 |
97 EngineComponentsFactory::Switches factory_switches = { | 98 EngineComponentsFactory::Switches factory_switches = { |
98 EngineComponentsFactory::ENCRYPTION_KEYSTORE, | 99 EngineComponentsFactory::ENCRYPTION_KEYSTORE, |
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
816 const SyncManager::ClearServerDataCallback& frontend_callback) { | 817 const SyncManager::ClearServerDataCallback& frontend_callback) { |
817 DCHECK(ui_thread_->BelongsToCurrentThread()); | 818 DCHECK(ui_thread_->BelongsToCurrentThread()); |
818 frontend_callback.Run(); | 819 frontend_callback.Run(); |
819 } | 820 } |
820 | 821 |
821 } // namespace syncer | 822 } // namespace syncer |
822 | 823 |
823 #undef SDVLOG | 824 #undef SDVLOG |
824 | 825 |
825 #undef SLOG | 826 #undef SLOG |
OLD | NEW |