Chromium Code Reviews| Index: components/browser_sync/profile_sync_service.cc |
| diff --git a/components/browser_sync/profile_sync_service.cc b/components/browser_sync/profile_sync_service.cc |
| index 7cbe502b1b599459b0288eef0e0728695f71332d..ce4d28fdef56b88c16cc5de887c6f1b4e09e271c 100644 |
| --- a/components/browser_sync/profile_sync_service.cc |
| +++ b/components/browser_sync/profile_sync_service.cc |
| @@ -108,7 +108,7 @@ using syncer::ModelTypeChangeProcessor; |
| using syncer::ModelTypeSet; |
| using syncer::ModelTypeStore; |
| using syncer::ProtocolEventObserver; |
| -using syncer::SyncBackendHost; |
| +using syncer::SyncEngine; |
| using syncer::SyncCredentials; |
| using syncer::SyncProtocolError; |
| using syncer::WeakHandle; |
| @@ -536,11 +536,10 @@ void ProfileSyncService::InitializeBackend(bool delete_stale_data) { |
| local_sync_backend_folder.Append(kLoopbackServerBackendFilename); |
| #endif // defined(OS_WIN) |
| - SyncBackendHost::HttpPostProviderFactoryGetter |
| - http_post_provider_factory_getter = |
| - base::Bind(&syncer::NetworkResources::GetHttpPostProviderFactory, |
| - base::Unretained(network_resources_.get()), |
| - url_request_context_, network_time_update_callback_); |
| + SyncEngine::HttpPostProviderFactoryGetter http_post_provider_factory_getter = |
| + base::Bind(&syncer::NetworkResources::GetHttpPostProviderFactory, |
| + base::Unretained(network_resources_.get()), |
| + url_request_context_, network_time_update_callback_); |
| backend_->Initialize( |
| this, sync_thread_->task_runner(), GetJsEventHandler(), sync_service_url_, |
| @@ -621,14 +620,12 @@ void ProfileSyncService::StartUpSlowBackendComponents() { |
| invalidation::InvalidationService* invalidator = |
| sync_client_->GetInvalidationService(); |
| - backend_.reset( |
| - sync_client_->GetSyncApiComponentFactory()->CreateSyncBackendHost( |
| - debug_identifier_, invalidator, sync_prefs_.AsWeakPtr(), |
| - directory_path_)); |
| + backend_.reset(sync_client_->GetSyncApiComponentFactory()->CreateSyncEngine( |
| + debug_identifier_, invalidator, sync_prefs_.AsWeakPtr(), |
| + directory_path_)); |
| - // Initialize the backend. Every time we start up a new SyncBackendHost, |
| - // we'll want to start from a fresh SyncDB, so delete any old one that might |
| - // be there. |
| + // Initialize the backend. Every time we start up a new SyncEngine, we'll want |
| + // to start from a fresh SyncDB, so delete any old one that might be there. |
| InitializeBackend(ShouldDeleteSyncFolder()); |
| UpdateFirstSyncTimePref(); |
| @@ -788,7 +785,7 @@ void ProfileSyncService::ShutdownImpl(syncer::ShutdownReason reason) { |
| // Move aside the backend so nobody else tries to use it while we are |
| // shutting it down. |
| - std::unique_ptr<SyncBackendHost> doomed_backend(backend_.release()); |
| + std::unique_ptr<SyncEngine> doomed_backend(backend_.release()); |
| if (doomed_backend) { |
| doomed_backend->Shutdown(reason); |
| doomed_backend.reset(); |
| @@ -832,7 +829,7 @@ void ProfileSyncService::StopImpl(SyncStopDataFate data_fate) { |
| switch (data_fate) { |
| case KEEP_DATA: |
| // TODO(maxbogue): Investigate whether this logic can/should be moved |
| - // into ShutdownImpl or SyncBackendHost itself. |
| + // into ShutdownImpl or SyncEngine itself. |
|
skym
2016/12/02 20:54:54
This is so ambiguous and confusing with this name.
maxbogue
2016/12/02 23:59:27
Clarified it to "sync engine" (aka the last of the
|
| if (HasSyncingBackend()) { |
| backend_->UnregisterInvalidationIds(); |
| } |
| @@ -943,7 +940,7 @@ void ProfileSyncService::UpdateBackendInitUMA(bool success) { |
| base::Time on_backend_initialized_time = base::Time::Now(); |
| base::TimeDelta delta = |
| - on_backend_initialized_time - startup_controller_->start_backend_time(); |
| + on_backend_initialized_time - startup_controller_->start_engine_time(); |
| if (is_first_time_sync_configure_) { |
| UMA_HISTOGRAM_LONG_TIMES("Sync.BackendInitializeFirstTime", delta); |
| } else { |
| @@ -1475,20 +1472,19 @@ std::string ProfileSyncService::QuerySyncStatusSummaryString() { |
| } |
| std::string ProfileSyncService::GetBackendInitializationStateString() const { |
| - return startup_controller_->GetBackendInitializationStateString(); |
| + return startup_controller_->GetEngineInitializationStateString(); |
| } |
| bool ProfileSyncService::IsSetupInProgress() const { |
| return startup_controller_->IsSetupInProgress(); |
| } |
| -bool ProfileSyncService::QueryDetailedSyncStatus( |
| - SyncBackendHost::Status* result) { |
| +bool ProfileSyncService::QueryDetailedSyncStatus(SyncEngine::Status* result) { |
| if (backend_.get() && backend_initialized_) { |
| *result = backend_->GetDetailedStatus(); |
| return true; |
| } else { |
| - SyncBackendHost::Status status; |
| + SyncEngine::Status status; |
| status.sync_protocol_error = last_actionable_error_; |
| *result = status; |
| return false; |
| @@ -1866,7 +1862,7 @@ std::unique_ptr<base::Value> ProfileSyncService::GetTypeStatusMap() { |
| } |
| } |
| - SyncBackendHost::Status detailed_status = backend_->GetDetailedStatus(); |
| + SyncEngine::Status detailed_status = backend_->GetDetailedStatus(); |
| ModelTypeSet& throttled_types(detailed_status.throttled_types); |
| ModelTypeSet& backed_off_types(detailed_status.backed_off_types); |
| ModelTypeSet registered = GetRegisteredDataTypes(); |