Chromium Code Reviews| 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 6a6b6be47af77cb933e81dc0724ba6d5b1d49e3a..fc8dfb197cc997e718adf7620b9d848bc89ebf47 100644 |
| --- a/components/sync/engine_impl/sync_manager_impl.cc |
| +++ b/components/sync/engine_impl/sync_manager_impl.cc |
| @@ -11,6 +11,7 @@ |
| #include "base/base64.h" |
| #include "base/bind.h" |
| #include "base/callback.h" |
| +#include "base/command_line.h" |
|
pavely
2016/10/27 23:53:39
I don't think you use CommandLine in this file.
pastarmovj
2016/11/02 13:39:25
Done.
|
| #include "base/compiler_specific.h" |
| #include "base/json/json_writer.h" |
| #include "base/memory/ptr_util.h" |
| @@ -46,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; |
| @@ -281,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); |