Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(583)

Side by Side Diff: components/sync/driver/glue/sync_backend_host_impl.cc

Issue 2470153002: Revert of [Sync] Adds a new switch for enabling the new local server backend. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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,
84 std::unique_ptr<SyncManagerFactory> sync_manager_factory, 82 std::unique_ptr<SyncManagerFactory> sync_manager_factory,
85 const WeakHandle<UnrecoverableErrorHandler>& unrecoverable_error_handler, 83 const WeakHandle<UnrecoverableErrorHandler>& unrecoverable_error_handler,
86 const base::Closure& report_unrecoverable_error_function, 84 const base::Closure& report_unrecoverable_error_function,
87 const HttpPostProviderFactoryGetter& http_post_provider_factory_getter, 85 const HttpPostProviderFactoryGetter& http_post_provider_factory_getter,
88 std::unique_ptr<SyncEncryptionHandler::NigoriState> saved_nigori_state) { 86 std::unique_ptr<SyncEncryptionHandler::NigoriState> saved_nigori_state) {
89 registrar_ = base::MakeUnique<SyncBackendRegistrar>( 87 registrar_ = base::MakeUnique<SyncBackendRegistrar>(
90 name_, sync_client_, std::move(sync_thread), ui_thread_, db_thread, 88 name_, sync_client_, std::move(sync_thread), ui_thread_, db_thread,
91 file_thread); 89 file_thread);
92 CHECK(registrar_->sync_thread()); 90 CHECK(registrar_->sync_thread());
93 91
(...skipping 20 matching lines...) Expand all
114 std::map<ModelType, int64_t> invalidation_versions; 112 std::map<ModelType, int64_t> invalidation_versions;
115 sync_prefs_->GetInvalidationVersions(&invalidation_versions); 113 sync_prefs_->GetInvalidationVersions(&invalidation_versions);
116 114
117 std::unique_ptr<DoInitializeOptions> init_opts(new DoInitializeOptions( 115 std::unique_ptr<DoInitializeOptions> init_opts(new DoInitializeOptions(
118 registrar_->sync_thread()->message_loop(), registrar_.get(), workers, 116 registrar_->sync_thread()->message_loop(), registrar_.get(), workers,
119 sync_client_->GetExtensionsActivity(), event_handler, sync_service_url, 117 sync_client_->GetExtensionsActivity(), event_handler, sync_service_url,
120 sync_user_agent, http_post_provider_factory_getter.Run( 118 sync_user_agent, http_post_provider_factory_getter.Run(
121 core_->GetRequestContextCancelationSignal()), 119 core_->GetRequestContextCancelationSignal()),
122 credentials, invalidator_ ? invalidator_->GetInvalidatorClientId() : "", 120 credentials, invalidator_ ? invalidator_->GetInvalidatorClientId() : "",
123 std::move(sync_manager_factory), delete_sync_data_folder, 121 std::move(sync_manager_factory), delete_sync_data_folder,
124 enable_local_sync_backend, local_sync_backend_folder,
125 sync_prefs_->GetEncryptionBootstrapToken(), 122 sync_prefs_->GetEncryptionBootstrapToken(),
126 sync_prefs_->GetKeystoreEncryptionBootstrapToken(), 123 sync_prefs_->GetKeystoreEncryptionBootstrapToken(),
127 std::unique_ptr<EngineComponentsFactory>( 124 std::unique_ptr<EngineComponentsFactory>(
128 new EngineComponentsFactoryImpl(factory_switches)), 125 new EngineComponentsFactoryImpl(factory_switches)),
129 unrecoverable_error_handler, report_unrecoverable_error_function, 126 unrecoverable_error_handler, report_unrecoverable_error_function,
130 std::move(saved_nigori_state), invalidation_versions)); 127 std::move(saved_nigori_state), invalidation_versions));
131 InitCore(std::move(init_opts)); 128 InitCore(std::move(init_opts));
132 } 129 }
133 130
134 void SyncBackendHostImpl::TriggerRefresh(const ModelTypeSet& types) { 131 void SyncBackendHostImpl::TriggerRefresh(const ModelTypeSet& types) {
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after
820 const SyncManager::ClearServerDataCallback& frontend_callback) { 817 const SyncManager::ClearServerDataCallback& frontend_callback) {
821 DCHECK(ui_thread_->BelongsToCurrentThread()); 818 DCHECK(ui_thread_->BelongsToCurrentThread());
822 frontend_callback.Run(); 819 frontend_callback.Run();
823 } 820 }
824 821
825 } // namespace syncer 822 } // namespace syncer
826 823
827 #undef SDVLOG 824 #undef SDVLOG
828 825
829 #undef SLOG 826 #undef SLOG
OLDNEW
« no previous file with comments | « components/sync/driver/glue/sync_backend_host_impl.h ('k') | components/sync/driver/glue/sync_backend_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698