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 |
index 5256442ec41869f7fa386832dd67633b91f354eb..363dbb8ed7ea787efee219290a466d6dd22dc788 100644 |
--- a/components/sync/driver/glue/sync_backend_host_impl.cc |
+++ b/components/sync/driver/glue/sync_backend_host_impl.cc |
@@ -38,14 +38,16 @@ |
#define SDVLOG(verbose_level) DVLOG(verbose_level) << name_ << ": " |
-namespace syncer { |
+using syncer::InternalComponentsFactory; |
+ |
+namespace browser_sync { |
SyncBackendHostImpl::SyncBackendHostImpl( |
const std::string& name, |
- SyncClient* sync_client, |
+ sync_driver::SyncClient* sync_client, |
const scoped_refptr<base::SingleThreadTaskRunner>& ui_thread, |
invalidation::InvalidationService* invalidator, |
- const base::WeakPtr<SyncPrefs>& sync_prefs, |
+ const base::WeakPtr<sync_driver::SyncPrefs>& sync_prefs, |
const base::FilePath& sync_folder) |
: frontend_task_runner_(base::ThreadTaskRunnerHandle::Get()), |
sync_client_(sync_client), |
@@ -54,7 +56,7 @@ SyncBackendHostImpl::SyncBackendHostImpl( |
initialized_(false), |
sync_prefs_(sync_prefs), |
frontend_(NULL), |
- cached_passphrase_type_(PassphraseType::IMPLICIT_PASSPHRASE), |
+ cached_passphrase_type_(syncer::PassphraseType::IMPLICIT_PASSPHRASE), |
invalidator_(invalidator), |
invalidation_handler_registered_(false), |
weak_ptr_factory_(this) { |
@@ -69,29 +71,31 @@ SyncBackendHostImpl::~SyncBackendHostImpl() { |
} |
void SyncBackendHostImpl::Initialize( |
- SyncFrontend* frontend, |
+ sync_driver::SyncFrontend* frontend, |
std::unique_ptr<base::Thread> sync_thread, |
const scoped_refptr<base::SingleThreadTaskRunner>& db_thread, |
const scoped_refptr<base::SingleThreadTaskRunner>& file_thread, |
- const WeakHandle<JsEventHandler>& event_handler, |
+ const syncer::WeakHandle<syncer::JsEventHandler>& event_handler, |
const GURL& sync_service_url, |
const std::string& sync_user_agent, |
- const SyncCredentials& credentials, |
+ const syncer::SyncCredentials& credentials, |
bool delete_sync_data_folder, |
- std::unique_ptr<SyncManagerFactory> sync_manager_factory, |
- const WeakHandle<UnrecoverableErrorHandler>& unrecoverable_error_handler, |
+ std::unique_ptr<syncer::SyncManagerFactory> sync_manager_factory, |
+ const syncer::WeakHandle<syncer::UnrecoverableErrorHandler>& |
+ unrecoverable_error_handler, |
const base::Closure& report_unrecoverable_error_function, |
const HttpPostProviderFactoryGetter& http_post_provider_factory_getter, |
- std::unique_ptr<SyncEncryptionHandler::NigoriState> saved_nigori_state) { |
- registrar_.reset(new SyncBackendRegistrar(name_, sync_client_, |
- std::move(sync_thread), ui_thread_, |
- db_thread, file_thread)); |
+ std::unique_ptr<syncer::SyncEncryptionHandler::NigoriState> |
+ saved_nigori_state) { |
+ registrar_.reset(new browser_sync::SyncBackendRegistrar( |
+ name_, sync_client_, std::move(sync_thread), ui_thread_, db_thread, |
+ file_thread)); |
CHECK(registrar_->sync_thread()); |
frontend_ = frontend; |
DCHECK(frontend); |
- std::vector<scoped_refptr<ModelSafeWorker>> workers; |
+ std::vector<scoped_refptr<syncer::ModelSafeWorker>> workers; |
registrar_->GetWorkers(&workers); |
InternalComponentsFactory::Switches factory_switches = { |
@@ -108,7 +112,7 @@ void SyncBackendHostImpl::Initialize( |
InternalComponentsFactory::FORCE_ENABLE_PRE_COMMIT_UPDATE_AVOIDANCE; |
} |
- std::map<ModelType, int64_t> invalidation_versions; |
+ std::map<syncer::ModelType, int64_t> invalidation_versions; |
sync_prefs_->GetInvalidationVersions(&invalidation_versions); |
std::unique_ptr<DoInitializeOptions> init_opts(new DoInitializeOptions( |
@@ -121,13 +125,13 @@ void SyncBackendHostImpl::Initialize( |
sync_prefs_->GetEncryptionBootstrapToken(), |
sync_prefs_->GetKeystoreEncryptionBootstrapToken(), |
std::unique_ptr<InternalComponentsFactory>( |
- new InternalComponentsFactoryImpl(factory_switches)), |
+ new syncer::InternalComponentsFactoryImpl(factory_switches)), |
unrecoverable_error_handler, report_unrecoverable_error_function, |
std::move(saved_nigori_state), invalidation_versions)); |
InitCore(std::move(init_opts)); |
} |
-void SyncBackendHostImpl::TriggerRefresh(const ModelTypeSet& types) { |
+void SyncBackendHostImpl::TriggerRefresh(const syncer::ModelTypeSet& types) { |
DCHECK(ui_thread_->BelongsToCurrentThread()); |
registrar_->sync_thread()->task_runner()->PostTask( |
FROM_HERE, |
@@ -135,7 +139,7 @@ void SyncBackendHostImpl::TriggerRefresh(const ModelTypeSet& types) { |
} |
void SyncBackendHostImpl::UpdateCredentials( |
- const SyncCredentials& credentials) { |
+ const syncer::SyncCredentials& credentials) { |
DCHECK(registrar_->sync_thread()->IsRunning()); |
registrar_->sync_thread()->task_runner()->PostTask( |
FROM_HERE, base::Bind(&SyncBackendHostCore::DoUpdateCredentials, |
@@ -145,7 +149,7 @@ void SyncBackendHostImpl::UpdateCredentials( |
void SyncBackendHostImpl::StartSyncingWithServer() { |
SDVLOG(1) << "SyncBackendHostImpl::StartSyncingWithServer called."; |
- ModelSafeRoutingInfo routing_info; |
+ syncer::ModelSafeRoutingInfo routing_info; |
registrar_->GetModelSafeRoutingInfo(&routing_info); |
registrar_->sync_thread()->task_runner()->PostTask( |
@@ -170,8 +174,9 @@ void SyncBackendHostImpl::SetEncryptionPassphrase(const std::string& passphrase, |
// SetEncryptionPassphrase should never be called if we are currently |
// encrypted with an explicit passphrase. |
- DCHECK(cached_passphrase_type_ == PassphraseType::KEYSTORE_PASSPHRASE || |
- cached_passphrase_type_ == PassphraseType::IMPLICIT_PASSPHRASE); |
+ DCHECK( |
+ cached_passphrase_type_ == syncer::PassphraseType::KEYSTORE_PASSPHRASE || |
+ cached_passphrase_type_ == syncer::PassphraseType::IMPLICIT_PASSPHRASE); |
// Post an encryption task on the syncer thread. |
registrar_->sync_thread()->task_runner()->PostTask( |
@@ -234,16 +239,16 @@ void SyncBackendHostImpl::StopSyncingForShutdown() { |
} |
std::unique_ptr<base::Thread> SyncBackendHostImpl::Shutdown( |
- ShutdownReason reason) { |
+ syncer::ShutdownReason reason) { |
// StopSyncingForShutdown() (which nulls out |frontend_|) should be |
// called first. |
DCHECK(!frontend_); |
DCHECK(registrar_->sync_thread()->IsRunning()); |
- bool sync_thread_claimed = (reason != BROWSER_SHUTDOWN); |
+ bool sync_thread_claimed = (reason != syncer::BROWSER_SHUTDOWN); |
if (invalidation_handler_registered_) { |
- if (reason == DISABLE_SYNC) { |
+ if (reason == syncer::DISABLE_SYNC) { |
UnregisterInvalidationIds(); |
} |
invalidator_->UnregisterInvalidationHandler(this); |
@@ -273,14 +278,16 @@ std::unique_ptr<base::Thread> SyncBackendHostImpl::Shutdown( |
void SyncBackendHostImpl::UnregisterInvalidationIds() { |
if (invalidation_handler_registered_) { |
- CHECK(invalidator_->UpdateRegisteredInvalidationIds(this, ObjectIdSet())); |
+ CHECK(invalidator_->UpdateRegisteredInvalidationIds(this, |
+ syncer::ObjectIdSet())); |
} |
} |
-ModelTypeSet SyncBackendHostImpl::ConfigureDataTypes( |
- ConfigureReason reason, |
+syncer::ModelTypeSet SyncBackendHostImpl::ConfigureDataTypes( |
+ syncer::ConfigureReason reason, |
const DataTypeConfigStateMap& config_state_map, |
- const base::Callback<void(ModelTypeSet, ModelTypeSet)>& ready_task, |
+ const base::Callback<void(syncer::ModelTypeSet, syncer::ModelTypeSet)>& |
+ ready_task, |
const base::Callback<void()>& retry_callback) { |
// Only one configure is allowed at a time. This is guaranteed by our |
// callers. The SyncBackendHostImpl requests one configure as the backend is |
@@ -303,25 +310,29 @@ ModelTypeSet SyncBackendHostImpl::ConfigureDataTypes( |
// backend because configuration requests are never aborted; they are retried |
// until they succeed or the backend is shut down. |
- ModelTypeSet disabled_types = GetDataTypesInState(DISABLED, config_state_map); |
- ModelTypeSet fatal_types = GetDataTypesInState(FATAL, config_state_map); |
- ModelTypeSet crypto_types = GetDataTypesInState(CRYPTO, config_state_map); |
- ModelTypeSet unready_types = GetDataTypesInState(UNREADY, config_state_map); |
+ syncer::ModelTypeSet disabled_types = |
+ GetDataTypesInState(DISABLED, config_state_map); |
+ syncer::ModelTypeSet fatal_types = |
+ GetDataTypesInState(FATAL, config_state_map); |
+ syncer::ModelTypeSet crypto_types = |
+ GetDataTypesInState(CRYPTO, config_state_map); |
+ syncer::ModelTypeSet unready_types = |
+ GetDataTypesInState(UNREADY, config_state_map); |
disabled_types.PutAll(fatal_types); |
disabled_types.PutAll(crypto_types); |
disabled_types.PutAll(unready_types); |
- ModelTypeSet active_types = |
+ syncer::ModelTypeSet active_types = |
GetDataTypesInState(CONFIGURE_ACTIVE, config_state_map); |
- ModelTypeSet clean_first_types = |
+ syncer::ModelTypeSet clean_first_types = |
GetDataTypesInState(CONFIGURE_CLEAN, config_state_map); |
- ModelTypeSet types_to_download = registrar_->ConfigureDataTypes( |
- Union(active_types, clean_first_types), disabled_types); |
+ syncer::ModelTypeSet types_to_download = registrar_->ConfigureDataTypes( |
+ syncer::Union(active_types, clean_first_types), disabled_types); |
types_to_download.PutAll(clean_first_types); |
- types_to_download.RemoveAll(ProxyTypes()); |
+ types_to_download.RemoveAll(syncer::ProxyTypes()); |
if (!types_to_download.Empty()) |
- types_to_download.Put(NIGORI); |
+ types_to_download.Put(syncer::NIGORI); |
// TODO(sync): crbug.com/137550. |
// It's dangerous to configure types that have progress markers. Types with |
@@ -345,12 +356,13 @@ ModelTypeSet SyncBackendHostImpl::ConfigureDataTypes( |
// non-nigori type in the request requires migration, a MIGRATION_DONE |
// response will be sent. |
- ModelSafeRoutingInfo routing_info; |
+ syncer::ModelSafeRoutingInfo routing_info; |
registrar_->GetModelSafeRoutingInfo(&routing_info); |
- ModelTypeSet current_types = registrar_->GetLastConfiguredTypes(); |
- ModelTypeSet types_to_purge = Difference(ModelTypeSet::All(), current_types); |
- ModelTypeSet inactive_types = |
+ syncer::ModelTypeSet current_types = registrar_->GetLastConfiguredTypes(); |
+ syncer::ModelTypeSet types_to_purge = |
+ syncer::Difference(syncer::ModelTypeSet::All(), current_types); |
+ syncer::ModelTypeSet inactive_types = |
GetDataTypesInState(CONFIGURE_INACTIVE, config_state_map); |
types_to_purge.RemoveAll(inactive_types); |
types_to_purge.RemoveAll(unready_types); |
@@ -359,14 +371,15 @@ ModelTypeSet SyncBackendHostImpl::ConfigureDataTypes( |
// not be part of the |types_to_purge| set, and therefore does not need |
// to be acted on again. |
fatal_types.RetainAll(types_to_purge); |
- ModelTypeSet unapply_types = Union(crypto_types, clean_first_types); |
+ syncer::ModelTypeSet unapply_types = |
+ syncer::Union(crypto_types, clean_first_types); |
unapply_types.RetainAll(types_to_purge); |
- DCHECK(Intersection(current_types, fatal_types).Empty()); |
- DCHECK(Intersection(current_types, crypto_types).Empty()); |
+ DCHECK(syncer::Intersection(current_types, fatal_types).Empty()); |
+ DCHECK(syncer::Intersection(current_types, crypto_types).Empty()); |
DCHECK(current_types.HasAll(types_to_download)); |
- SDVLOG(1) << "Types " << 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): |
@@ -384,11 +397,11 @@ ModelTypeSet SyncBackendHostImpl::ConfigureDataTypes( |
unapply_types, inactive_types, routing_info, |
ready_task, retry_callback); |
- DCHECK(Intersection(active_types, types_to_purge).Empty()); |
- DCHECK(Intersection(active_types, fatal_types).Empty()); |
- DCHECK(Intersection(active_types, unapply_types).Empty()); |
- DCHECK(Intersection(active_types, inactive_types).Empty()); |
- return Difference(active_types, types_to_download); |
+ DCHECK(syncer::Intersection(active_types, types_to_purge).Empty()); |
+ DCHECK(syncer::Intersection(active_types, fatal_types).Empty()); |
+ DCHECK(syncer::Intersection(active_types, unapply_types).Empty()); |
+ DCHECK(syncer::Intersection(active_types, inactive_types).Empty()); |
+ return syncer::Difference(active_types, types_to_download); |
} |
void SyncBackendHostImpl::EnableEncryptEverything() { |
@@ -398,30 +411,31 @@ void SyncBackendHostImpl::EnableEncryptEverything() { |
} |
void SyncBackendHostImpl::ActivateDirectoryDataType( |
- ModelType type, |
- ModelSafeGroup group, |
- ChangeProcessor* change_processor) { |
+ syncer::ModelType type, |
+ syncer::ModelSafeGroup group, |
+ sync_driver::ChangeProcessor* change_processor) { |
registrar_->ActivateDataType(type, group, change_processor, GetUserShare()); |
} |
-void SyncBackendHostImpl::DeactivateDirectoryDataType(ModelType type) { |
+void SyncBackendHostImpl::DeactivateDirectoryDataType(syncer::ModelType type) { |
registrar_->DeactivateDataType(type); |
} |
void SyncBackendHostImpl::ActivateNonBlockingDataType( |
- ModelType type, |
- std::unique_ptr<ActivationContext> activation_context) { |
+ syncer::ModelType type, |
+ std::unique_ptr<syncer_v2::ActivationContext> activation_context) { |
registrar_->RegisterNonBlockingType(type); |
if (activation_context->data_type_state.initial_sync_done()) |
registrar_->AddRestoredNonBlockingType(type); |
model_type_connector_->ConnectType(type, std::move(activation_context)); |
} |
-void SyncBackendHostImpl::DeactivateNonBlockingDataType(ModelType type) { |
+void SyncBackendHostImpl::DeactivateNonBlockingDataType( |
+ syncer::ModelType type) { |
model_type_connector_->DisconnectType(type); |
} |
-UserShare* SyncBackendHostImpl::GetUserShare() const { |
+syncer::UserShare* SyncBackendHostImpl::GetUserShare() const { |
return core_->sync_manager()->GetUserShare(); |
} |
@@ -430,7 +444,7 @@ SyncBackendHostImpl::Status SyncBackendHostImpl::GetDetailedStatus() { |
return core_->sync_manager()->GetDetailedStatus(); |
} |
-SyncCycleSnapshot SyncBackendHostImpl::GetLastCycleSnapshot() const { |
+syncer::SyncCycleSnapshot SyncBackendHostImpl::GetLastCycleSnapshot() const { |
return last_snapshot_; |
} |
@@ -443,7 +457,7 @@ bool SyncBackendHostImpl::IsNigoriEnabled() const { |
return registrar_.get() && registrar_->IsNigoriEnabled(); |
} |
-PassphraseType SyncBackendHostImpl::GetPassphraseType() const { |
+syncer::PassphraseType SyncBackendHostImpl::GetPassphraseType() const { |
return cached_passphrase_type_; |
} |
@@ -452,13 +466,13 @@ base::Time SyncBackendHostImpl::GetExplicitPassphraseTime() const { |
} |
bool SyncBackendHostImpl::IsCryptographerReady( |
- const BaseTransaction* trans) const { |
+ const syncer::BaseTransaction* trans) const { |
return initialized() && trans->GetCryptographer() && |
trans->GetCryptographer()->is_ready(); |
} |
void SyncBackendHostImpl::GetModelSafeRoutingInfo( |
- ModelSafeRoutingInfo* out) const { |
+ syncer::ModelSafeRoutingInfo* out) const { |
if (initialized()) { |
CHECK(registrar_.get()); |
registrar_->GetModelSafeRoutingInfo(out); |
@@ -511,14 +525,15 @@ void SyncBackendHostImpl::InitCore( |
} |
void SyncBackendHostImpl::RequestConfigureSyncer( |
- ConfigureReason reason, |
- ModelTypeSet to_download, |
- ModelTypeSet to_purge, |
- ModelTypeSet to_journal, |
- ModelTypeSet to_unapply, |
- ModelTypeSet to_ignore, |
- const ModelSafeRoutingInfo& routing_info, |
- const base::Callback<void(ModelTypeSet, ModelTypeSet)>& ready_task, |
+ syncer::ConfigureReason reason, |
+ syncer::ModelTypeSet to_download, |
+ syncer::ModelTypeSet to_purge, |
+ syncer::ModelTypeSet to_journal, |
+ 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::Closure& retry_callback) { |
DoConfigureSyncerTypes config_types; |
config_types.to_download = to_download; |
@@ -532,10 +547,11 @@ void SyncBackendHostImpl::RequestConfigureSyncer( |
} |
void SyncBackendHostImpl::FinishConfigureDataTypesOnFrontendLoop( |
- const ModelTypeSet enabled_types, |
- const ModelTypeSet succeeded_configuration_types, |
- const ModelTypeSet failed_configuration_types, |
- const base::Callback<void(ModelTypeSet, ModelTypeSet)>& ready_task) { |
+ 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) { |
if (!frontend_) |
return; |
@@ -550,15 +566,16 @@ void SyncBackendHostImpl::FinishConfigureDataTypesOnFrontendLoop( |
void SyncBackendHostImpl::AddExperimentalTypes() { |
CHECK(initialized()); |
- Experiments experiments; |
+ syncer::Experiments experiments; |
if (core_->sync_manager()->ReceivedExperiment(&experiments)) |
frontend_->OnExperimentsChanged(experiments); |
} |
void SyncBackendHostImpl::HandleInitializationSuccessOnFrontendLoop( |
- const WeakHandle<JsBackend> js_backend, |
- const WeakHandle<DataTypeDebugInfoListener> debug_info_listener, |
- std::unique_ptr<ModelTypeConnector> model_type_connector, |
+ const syncer::WeakHandle<syncer::JsBackend> js_backend, |
+ const syncer::WeakHandle<syncer::DataTypeDebugInfoListener> |
+ debug_info_listener, |
+ std::unique_ptr<syncer_v2::ModelTypeConnector> model_type_connector, |
const std::string& cache_guid) { |
DCHECK(frontend_task_runner_->BelongsToCurrentThread()); |
@@ -591,13 +608,13 @@ void SyncBackendHostImpl::HandleInitializationFailureOnFrontendLoop() { |
if (!frontend_) |
return; |
- frontend_->OnBackendInitialized(WeakHandle<JsBackend>(), |
- WeakHandle<DataTypeDebugInfoListener>(), "", |
- false); |
+ frontend_->OnBackendInitialized( |
+ syncer::WeakHandle<syncer::JsBackend>(), |
+ syncer::WeakHandle<syncer::DataTypeDebugInfoListener>(), "", false); |
} |
void SyncBackendHostImpl::HandleSyncCycleCompletedOnFrontendLoop( |
- const SyncCycleSnapshot& snapshot) { |
+ const syncer::SyncCycleSnapshot& snapshot) { |
if (!frontend_) |
return; |
DCHECK(frontend_task_runner_->BelongsToCurrentThread()); |
@@ -626,16 +643,16 @@ void SyncBackendHostImpl::RetryConfigurationOnFrontendLoop( |
void SyncBackendHostImpl::PersistEncryptionBootstrapToken( |
const std::string& token, |
- BootstrapTokenType token_type) { |
+ syncer::BootstrapTokenType token_type) { |
CHECK(sync_prefs_.get()); |
- if (token_type == PASSPHRASE_BOOTSTRAP_TOKEN) |
+ if (token_type == syncer::PASSPHRASE_BOOTSTRAP_TOKEN) |
sync_prefs_->SetEncryptionBootstrapToken(token); |
else |
sync_prefs_->SetKeystoreEncryptionBootstrapToken(token); |
} |
void SyncBackendHostImpl::HandleActionableErrorEventOnFrontendLoop( |
- const SyncProtocolError& sync_error) { |
+ const syncer::SyncProtocolError& sync_error) { |
if (!frontend_) |
return; |
DCHECK(frontend_task_runner_->BelongsToCurrentThread()); |
@@ -643,21 +660,22 @@ void SyncBackendHostImpl::HandleActionableErrorEventOnFrontendLoop( |
} |
void SyncBackendHostImpl::HandleMigrationRequestedOnFrontendLoop( |
- ModelTypeSet types) { |
+ syncer::ModelTypeSet types) { |
if (!frontend_) |
return; |
DCHECK(frontend_task_runner_->BelongsToCurrentThread()); |
frontend_->OnMigrationNeededForTypes(types); |
} |
-void SyncBackendHostImpl::OnInvalidatorStateChange(InvalidatorState state) { |
+void SyncBackendHostImpl::OnInvalidatorStateChange( |
+ syncer::InvalidatorState state) { |
registrar_->sync_thread()->task_runner()->PostTask( |
FROM_HERE, base::Bind(&SyncBackendHostCore::DoOnInvalidatorStateChange, |
core_, state)); |
} |
void SyncBackendHostImpl::OnIncomingInvalidation( |
- const ObjectIdInvalidationMap& invalidation_map) { |
+ const syncer::ObjectIdInvalidationMap& invalidation_map) { |
registrar_->sync_thread()->task_runner()->PostTask( |
FROM_HERE, base::Bind(&SyncBackendHostCore::DoOnIncomingInvalidation, |
core_, invalidation_map)); |
@@ -671,7 +689,7 @@ bool SyncBackendHostImpl::CheckPassphraseAgainstCachedPendingKeys( |
const std::string& passphrase) const { |
DCHECK(cached_pending_keys_.has_blob()); |
DCHECK(!passphrase.empty()); |
- Nigori nigori; |
+ syncer::Nigori nigori; |
nigori.InitByDerivation("localhost", "dummy", passphrase); |
std::string plaintext; |
bool result = nigori.Decrypt(cached_pending_keys_.blob(), &plaintext); |
@@ -680,7 +698,7 @@ bool SyncBackendHostImpl::CheckPassphraseAgainstCachedPendingKeys( |
} |
void SyncBackendHostImpl::NotifyPassphraseRequired( |
- PassphraseRequiredReason reason, |
+ syncer::PassphraseRequiredReason reason, |
sync_pb::EncryptedData pending_keys) { |
if (!frontend_) |
return; |
@@ -705,7 +723,7 @@ void SyncBackendHostImpl::NotifyPassphraseAccepted() { |
} |
void SyncBackendHostImpl::NotifyEncryptedTypesChanged( |
- ModelTypeSet encrypted_types, |
+ syncer::ModelTypeSet encrypted_types, |
bool encrypt_everything) { |
if (!frontend_) |
return; |
@@ -723,64 +741,66 @@ void SyncBackendHostImpl::NotifyEncryptionComplete() { |
} |
void SyncBackendHostImpl::HandlePassphraseTypeChangedOnFrontendLoop( |
- PassphraseType type, |
+ syncer::PassphraseType type, |
base::Time explicit_passphrase_time) { |
DCHECK(frontend_task_runner_->BelongsToCurrentThread()); |
- DVLOG(1) << "Passphrase type changed to " << PassphraseTypeToString(type); |
+ DVLOG(1) << "Passphrase type changed to " |
+ << syncer::PassphraseTypeToString(type); |
cached_passphrase_type_ = type; |
cached_explicit_passphrase_time_ = explicit_passphrase_time; |
} |
void SyncBackendHostImpl::HandleLocalSetPassphraseEncryptionOnFrontendLoop( |
- const SyncEncryptionHandler::NigoriState& nigori_state) { |
+ const syncer::SyncEncryptionHandler::NigoriState& nigori_state) { |
DCHECK(frontend_task_runner_->BelongsToCurrentThread()); |
frontend_->OnLocalSetPassphraseEncryption(nigori_state); |
} |
void SyncBackendHostImpl::HandleConnectionStatusChangeOnFrontendLoop( |
- ConnectionStatus status) { |
+ syncer::ConnectionStatus status) { |
if (!frontend_) |
return; |
DCHECK(frontend_task_runner_->BelongsToCurrentThread()); |
- DVLOG(1) << "Connection status changed: " << ConnectionStatusToString(status); |
+ DVLOG(1) << "Connection status changed: " |
+ << syncer::ConnectionStatusToString(status); |
frontend_->OnConnectionStatusChange(status); |
} |
void SyncBackendHostImpl::HandleProtocolEventOnFrontendLoop( |
- std::unique_ptr<ProtocolEvent> event) { |
+ std::unique_ptr<syncer::ProtocolEvent> event) { |
if (!frontend_) |
return; |
frontend_->OnProtocolEvent(*event); |
} |
void SyncBackendHostImpl::HandleDirectoryCommitCountersUpdatedOnFrontendLoop( |
- ModelType type, |
- const CommitCounters& counters) { |
+ syncer::ModelType type, |
+ const syncer::CommitCounters& counters) { |
if (!frontend_) |
return; |
frontend_->OnDirectoryTypeCommitCounterUpdated(type, counters); |
} |
void SyncBackendHostImpl::HandleDirectoryUpdateCountersUpdatedOnFrontendLoop( |
- ModelType type, |
- const UpdateCounters& counters) { |
+ syncer::ModelType type, |
+ const syncer::UpdateCounters& counters) { |
if (!frontend_) |
return; |
frontend_->OnDirectoryTypeUpdateCounterUpdated(type, counters); |
} |
void SyncBackendHostImpl::HandleDirectoryStatusCountersUpdatedOnFrontendLoop( |
- ModelType type, |
- const StatusCounters& counters) { |
+ syncer::ModelType type, |
+ const syncer::StatusCounters& counters) { |
if (!frontend_) |
return; |
frontend_->OnDirectoryTypeStatusCounterUpdated(type, counters); |
} |
void SyncBackendHostImpl::UpdateInvalidationVersions( |
- const std::map<ModelType, int64_t>& invalidation_versions) { |
+ const std::map<syncer::ModelType, int64_t>& invalidation_versions) { |
sync_prefs_->UpdateInvalidationVersions(invalidation_versions); |
} |
@@ -788,7 +808,7 @@ base::MessageLoop* SyncBackendHostImpl::GetSyncLoopForTesting() { |
return registrar_->sync_thread()->message_loop(); |
} |
-void SyncBackendHostImpl::RefreshTypesForTest(ModelTypeSet types) { |
+void SyncBackendHostImpl::RefreshTypesForTest(syncer::ModelTypeSet types) { |
DCHECK(ui_thread_->BelongsToCurrentThread()); |
registrar_->sync_thread()->task_runner()->PostTask( |
@@ -797,7 +817,7 @@ void SyncBackendHostImpl::RefreshTypesForTest(ModelTypeSet types) { |
} |
void SyncBackendHostImpl::ClearServerData( |
- const SyncManager::ClearServerDataCallback& callback) { |
+ const syncer::SyncManager::ClearServerDataCallback& callback) { |
DCHECK(ui_thread_->BelongsToCurrentThread()); |
registrar_->sync_thread()->task_runner()->PostTask( |
FROM_HERE, base::Bind(&SyncBackendHostCore::DoClearServerData, |
@@ -813,12 +833,12 @@ void SyncBackendHostImpl::OnCookieJarChanged(bool account_mismatch, |
} |
void SyncBackendHostImpl::ClearServerDataDoneOnFrontendLoop( |
- const SyncManager::ClearServerDataCallback& frontend_callback) { |
+ const syncer::SyncManager::ClearServerDataCallback& frontend_callback) { |
DCHECK(ui_thread_->BelongsToCurrentThread()); |
frontend_callback.Run(); |
} |
-} // namespace syncer |
+} // namespace browser_sync |
#undef SDVLOG |