| 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" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 void SyncBackendHostImpl::Initialize( | 72 void SyncBackendHostImpl::Initialize( |
| 73 SyncFrontend* frontend, | 73 SyncFrontend* frontend, |
| 74 std::unique_ptr<base::Thread> sync_thread, | 74 std::unique_ptr<base::Thread> sync_thread, |
| 75 const scoped_refptr<base::SingleThreadTaskRunner>& db_thread, | 75 const scoped_refptr<base::SingleThreadTaskRunner>& db_thread, |
| 76 const scoped_refptr<base::SingleThreadTaskRunner>& file_thread, | 76 const scoped_refptr<base::SingleThreadTaskRunner>& file_thread, |
| 77 const WeakHandle<JsEventHandler>& event_handler, | 77 const WeakHandle<JsEventHandler>& event_handler, |
| 78 const GURL& sync_service_url, | 78 const GURL& sync_service_url, |
| 79 const std::string& sync_user_agent, | 79 const std::string& sync_user_agent, |
| 80 const SyncCredentials& credentials, | 80 const SyncCredentials& credentials, |
| 81 bool delete_sync_data_folder, | 81 bool delete_sync_data_folder, |
| 82 bool enable_local_sync_backend, |
| 83 const base::FilePath& local_sync_backend_folder, |
| 82 std::unique_ptr<SyncManagerFactory> sync_manager_factory, | 84 std::unique_ptr<SyncManagerFactory> sync_manager_factory, |
| 83 const WeakHandle<UnrecoverableErrorHandler>& unrecoverable_error_handler, | 85 const WeakHandle<UnrecoverableErrorHandler>& unrecoverable_error_handler, |
| 84 const base::Closure& report_unrecoverable_error_function, | 86 const base::Closure& report_unrecoverable_error_function, |
| 85 const HttpPostProviderFactoryGetter& http_post_provider_factory_getter, | 87 const HttpPostProviderFactoryGetter& http_post_provider_factory_getter, |
| 86 std::unique_ptr<SyncEncryptionHandler::NigoriState> saved_nigori_state) { | 88 std::unique_ptr<SyncEncryptionHandler::NigoriState> saved_nigori_state) { |
| 87 registrar_ = base::MakeUnique<SyncBackendRegistrar>( | 89 registrar_ = base::MakeUnique<SyncBackendRegistrar>( |
| 88 name_, sync_client_, std::move(sync_thread), ui_thread_, db_thread, | 90 name_, sync_client_, std::move(sync_thread), ui_thread_, db_thread, |
| 89 file_thread); | 91 file_thread); |
| 90 CHECK(registrar_->sync_thread()); | 92 CHECK(registrar_->sync_thread()); |
| 91 | 93 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 112 std::map<ModelType, int64_t> invalidation_versions; | 114 std::map<ModelType, int64_t> invalidation_versions; |
| 113 sync_prefs_->GetInvalidationVersions(&invalidation_versions); | 115 sync_prefs_->GetInvalidationVersions(&invalidation_versions); |
| 114 | 116 |
| 115 std::unique_ptr<DoInitializeOptions> init_opts(new DoInitializeOptions( | 117 std::unique_ptr<DoInitializeOptions> init_opts(new DoInitializeOptions( |
| 116 registrar_->sync_thread()->message_loop(), registrar_.get(), workers, | 118 registrar_->sync_thread()->message_loop(), registrar_.get(), workers, |
| 117 sync_client_->GetExtensionsActivity(), event_handler, sync_service_url, | 119 sync_client_->GetExtensionsActivity(), event_handler, sync_service_url, |
| 118 sync_user_agent, http_post_provider_factory_getter.Run( | 120 sync_user_agent, http_post_provider_factory_getter.Run( |
| 119 core_->GetRequestContextCancelationSignal()), | 121 core_->GetRequestContextCancelationSignal()), |
| 120 credentials, invalidator_ ? invalidator_->GetInvalidatorClientId() : "", | 122 credentials, invalidator_ ? invalidator_->GetInvalidatorClientId() : "", |
| 121 std::move(sync_manager_factory), delete_sync_data_folder, | 123 std::move(sync_manager_factory), delete_sync_data_folder, |
| 124 enable_local_sync_backend, local_sync_backend_folder, |
| 122 sync_prefs_->GetEncryptionBootstrapToken(), | 125 sync_prefs_->GetEncryptionBootstrapToken(), |
| 123 sync_prefs_->GetKeystoreEncryptionBootstrapToken(), | 126 sync_prefs_->GetKeystoreEncryptionBootstrapToken(), |
| 124 std::unique_ptr<EngineComponentsFactory>( | 127 std::unique_ptr<EngineComponentsFactory>( |
| 125 new EngineComponentsFactoryImpl(factory_switches)), | 128 new EngineComponentsFactoryImpl(factory_switches)), |
| 126 unrecoverable_error_handler, report_unrecoverable_error_function, | 129 unrecoverable_error_handler, report_unrecoverable_error_function, |
| 127 std::move(saved_nigori_state), invalidation_versions)); | 130 std::move(saved_nigori_state), invalidation_versions)); |
| 128 InitCore(std::move(init_opts)); | 131 InitCore(std::move(init_opts)); |
| 129 } | 132 } |
| 130 | 133 |
| 131 void SyncBackendHostImpl::TriggerRefresh(const ModelTypeSet& types) { | 134 void SyncBackendHostImpl::TriggerRefresh(const ModelTypeSet& types) { |
| (...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 817 const SyncManager::ClearServerDataCallback& frontend_callback) { | 820 const SyncManager::ClearServerDataCallback& frontend_callback) { |
| 818 DCHECK(ui_thread_->BelongsToCurrentThread()); | 821 DCHECK(ui_thread_->BelongsToCurrentThread()); |
| 819 frontend_callback.Run(); | 822 frontend_callback.Run(); |
| 820 } | 823 } |
| 821 | 824 |
| 822 } // namespace syncer | 825 } // namespace syncer |
| 823 | 826 |
| 824 #undef SDVLOG | 827 #undef SDVLOG |
| 825 | 828 |
| 826 #undef SLOG | 829 #undef SLOG |
| OLD | NEW |