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

Unified Diff: components/sync/engine_impl/sync_manager_impl.cc

Issue 2442453002: [Sync] Adds a new switch for enabling the new local server backend. (Closed)
Patch Set: Fix InitArgs contructor. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/sync/engine_impl/sync_manager_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync/engine_impl/sync_manager_impl.cc
diff --git a/components/sync/engine_impl/sync_manager_impl.cc b/components/sync/engine_impl/sync_manager_impl.cc
index f0b7cada4332de19b27870ea39136655e47e80f2..06720a0318cd330c99eae2c460fe70087c2c9989 100644
--- a/components/sync/engine_impl/sync_manager_impl.cc
+++ b/components/sync/engine_impl/sync_manager_impl.cc
@@ -47,6 +47,10 @@
#include "components/sync/syncable/write_node.h"
#include "components/sync/syncable/write_transaction.h"
+#if defined(OS_WIN)
+#include "components/sync/engine_impl/loopback_server/loopback_connection_manager.h"
+#endif
+
using base::TimeDelta;
using sync_pb::GetUpdatesCallerInfo;
@@ -282,11 +286,21 @@ void SyncManagerImpl::Init(InitArgs* args) {
args->saved_nigori_state.reset();
}
- connection_manager_ = base::MakeUnique<SyncServerConnectionManager>(
- args->service_url.host() + args->service_url.path(),
- args->service_url.EffectiveIntPort(),
- args->service_url.SchemeIsCryptographic(), args->post_factory.release(),
- args->cancelation_signal);
+ if (args->enable_local_sync_backend) {
+#if defined(OS_WIN)
+ VLOG(1) << "Running against local sync backend.";
+ connection_manager_ = base::MakeUnique<LoopbackConnectionManager>(
+ args->cancelation_signal, args->local_sync_backend_folder);
+#else
+ NOTREACHED();
+#endif // defined(OS_WIN)
+ } else {
+ connection_manager_ = base::MakeUnique<SyncServerConnectionManager>(
+ args->service_url.host() + args->service_url.path(),
+ args->service_url.EffectiveIntPort(),
+ args->service_url.SchemeIsCryptographic(), args->post_factory.release(),
+ args->cancelation_signal);
+ }
connection_manager_->set_client_id(directory()->cache_guid());
connection_manager_->AddListener(this);
« no previous file with comments | « components/sync/engine_impl/sync_manager_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698