| Index: components/sync/driver/glue/sync_backend_host_impl.cc
|
| diff --git a/components/sync_driver/glue/sync_backend_host_impl.cc b/components/sync/driver/glue/sync_backend_host_impl.cc
|
| similarity index 94%
|
| rename from components/sync_driver/glue/sync_backend_host_impl.cc
|
| rename to components/sync/driver/glue/sync_backend_host_impl.cc
|
| index 5b0ae62ad7b406ce4c94bf1dbff1bb97f42cab5f..c53242be554bebcee57fd263bb87e1596f0c3768 100644
|
| --- a/components/sync_driver/glue/sync_backend_host_impl.cc
|
| +++ b/components/sync/driver/glue/sync_backend_host_impl.cc
|
| @@ -2,7 +2,7 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "components/sync_driver/glue/sync_backend_host_impl.h"
|
| +#include "components/sync/driver/glue/sync_backend_host_impl.h"
|
|
|
| #include <map>
|
| #include <utility>
|
| @@ -25,14 +25,14 @@
|
| #include "components/sync/core/internal_components_factory_impl.h"
|
| #include "components/sync/core/sync_manager.h"
|
| #include "components/sync/core/sync_manager_factory.h"
|
| +#include "components/sync/driver/glue/sync_backend_host_core.h"
|
| +#include "components/sync/driver/glue/sync_backend_registrar.h"
|
| +#include "components/sync/driver/invalidation_helper.h"
|
| +#include "components/sync/driver/sync_client.h"
|
| +#include "components/sync/driver/sync_driver_switches.h"
|
| +#include "components/sync/driver/sync_frontend.h"
|
| +#include "components/sync/driver/sync_prefs.h"
|
| #include "components/sync/engine/events/protocol_event.h"
|
| -#include "components/sync_driver/glue/sync_backend_host_core.h"
|
| -#include "components/sync_driver/glue/sync_backend_registrar.h"
|
| -#include "components/sync_driver/invalidation_helper.h"
|
| -#include "components/sync_driver/sync_client.h"
|
| -#include "components/sync_driver/sync_driver_switches.h"
|
| -#include "components/sync_driver/sync_frontend.h"
|
| -#include "components/sync_driver/sync_prefs.h"
|
|
|
| // Helper macros to log with the syncer thread name; useful when there
|
| // are multiple syncers involved.
|
| @@ -98,13 +98,12 @@ void SyncBackendHostImpl::Initialize(
|
| frontend_ = frontend;
|
| DCHECK(frontend);
|
|
|
| - std::vector<scoped_refptr<syncer::ModelSafeWorker> > workers;
|
| + std::vector<scoped_refptr<syncer::ModelSafeWorker>> workers;
|
| registrar_->GetWorkers(&workers);
|
|
|
| InternalComponentsFactory::Switches factory_switches = {
|
| - InternalComponentsFactory::ENCRYPTION_KEYSTORE,
|
| - InternalComponentsFactory::BACKOFF_NORMAL
|
| - };
|
| + InternalComponentsFactory::ENCRYPTION_KEYSTORE,
|
| + InternalComponentsFactory::BACKOFF_NORMAL};
|
|
|
| base::CommandLine* cl = base::CommandLine::ForCurrentProcess();
|
| if (cl->HasSwitch(switches::kSyncShortInitialRetryOverride)) {
|
| @@ -331,8 +330,7 @@ syncer::ModelTypeSet SyncBackendHostImpl::ConfigureDataTypes(
|
| syncer::ModelTypeSet clean_first_types =
|
| GetDataTypesInState(CONFIGURE_CLEAN, config_state_map);
|
| syncer::ModelTypeSet types_to_download = registrar_->ConfigureDataTypes(
|
| - syncer::Union(active_types, clean_first_types),
|
| - disabled_types);
|
| + syncer::Union(active_types, clean_first_types), disabled_types);
|
| types_to_download.PutAll(clean_first_types);
|
| types_to_download.RemoveAll(syncer::ProxyTypes());
|
| if (!types_to_download.Empty())
|
| @@ -383,8 +381,7 @@ syncer::ModelTypeSet SyncBackendHostImpl::ConfigureDataTypes(
|
| DCHECK(syncer::Intersection(current_types, crypto_types).Empty());
|
| DCHECK(current_types.HasAll(types_to_download));
|
|
|
| - SDVLOG(1) << "Types "
|
| - << syncer::ModelTypeSetToString(types_to_download)
|
| + SDVLOG(1) << "Types " << syncer::ModelTypeSetToString(types_to_download)
|
| << " added; calling DoConfigureSyncer";
|
| // Divide up the types into their corresponding actions (each is mutually
|
| // exclusive):
|
| @@ -398,15 +395,9 @@ syncer::ModelTypeSet SyncBackendHostImpl::ConfigureDataTypes(
|
| // from the directory.
|
| // - Everything else (enabled types and already disabled types) is not
|
| // touched.
|
| - RequestConfigureSyncer(reason,
|
| - types_to_download,
|
| - types_to_purge,
|
| - fatal_types,
|
| - unapply_types,
|
| - inactive_types,
|
| - routing_info,
|
| - ready_task,
|
| - retry_callback);
|
| + RequestConfigureSyncer(reason, types_to_download, types_to_purge, fatal_types,
|
| + unapply_types, inactive_types, routing_info,
|
| + ready_task, retry_callback);
|
|
|
| DCHECK(syncer::Intersection(active_types, types_to_purge).Empty());
|
| DCHECK(syncer::Intersection(active_types, fatal_types).Empty());
|
| @@ -480,7 +471,7 @@ base::Time SyncBackendHostImpl::GetExplicitPassphraseTime() const {
|
| bool SyncBackendHostImpl::IsCryptographerReady(
|
| const syncer::BaseTransaction* trans) const {
|
| return initialized() && trans->GetCryptographer() &&
|
| - trans->GetCryptographer()->is_ready();
|
| + trans->GetCryptographer()->is_ready();
|
| }
|
|
|
| void SyncBackendHostImpl::GetModelSafeRoutingInfo(
|
| @@ -554,8 +545,8 @@ void SyncBackendHostImpl::RequestConfigureSyncer(
|
| syncer::ModelTypeSet to_unapply,
|
| syncer::ModelTypeSet to_ignore,
|
| const syncer::ModelSafeRoutingInfo& routing_info,
|
| - const base::Callback<void(syncer::ModelTypeSet,
|
| - syncer::ModelTypeSet)>& ready_task,
|
| + const base::Callback<void(syncer::ModelTypeSet, syncer::ModelTypeSet)>&
|
| + ready_task,
|
| const base::Closure& retry_callback) {
|
| DoConfigureSyncerTypes config_types;
|
| config_types.to_download = to_download;
|
| @@ -572,8 +563,8 @@ void SyncBackendHostImpl::FinishConfigureDataTypesOnFrontendLoop(
|
| const syncer::ModelTypeSet enabled_types,
|
| const syncer::ModelTypeSet succeeded_configuration_types,
|
| const syncer::ModelTypeSet failed_configuration_types,
|
| - const base::Callback<void(syncer::ModelTypeSet,
|
| - syncer::ModelTypeSet)>& ready_task) {
|
| + const base::Callback<void(syncer::ModelTypeSet, syncer::ModelTypeSet)>&
|
| + ready_task) {
|
| if (!frontend_)
|
| return;
|
|
|
| @@ -621,9 +612,7 @@ void SyncBackendHostImpl::HandleInitializationSuccessOnFrontendLoop(
|
| // experimental types to enable. This should be done before we inform
|
| // the frontend to ensure they're visible in the customize screen.
|
| AddExperimentalTypes();
|
| - frontend_->OnBackendInitialized(js_backend,
|
| - debug_info_listener,
|
| - cache_guid,
|
| + frontend_->OnBackendInitialized(js_backend, debug_info_listener, cache_guid,
|
| true);
|
| }
|
|
|
| @@ -634,9 +623,7 @@ void SyncBackendHostImpl::HandleInitializationFailureOnFrontendLoop() {
|
|
|
| frontend_->OnBackendInitialized(
|
| syncer::WeakHandle<syncer::JsBackend>(),
|
| - syncer::WeakHandle<syncer::DataTypeDebugInfoListener>(),
|
| - "",
|
| - false);
|
| + syncer::WeakHandle<syncer::DataTypeDebugInfoListener>(), "", false);
|
| }
|
|
|
| void SyncBackendHostImpl::HandleSyncCycleCompletedOnFrontendLoop(
|
| @@ -755,8 +742,7 @@ void SyncBackendHostImpl::NotifyEncryptedTypesChanged(
|
| return;
|
|
|
| DCHECK(frontend_task_runner_->BelongsToCurrentThread());
|
| - frontend_->OnEncryptedTypesChanged(
|
| - encrypted_types, encrypt_everything);
|
| + frontend_->OnEncryptedTypesChanged(encrypted_types, encrypt_everything);
|
| }
|
|
|
| void SyncBackendHostImpl::NotifyEncryptionComplete() {
|
|
|