Index: components/browser_sync/browser/profile_sync_service.cc |
diff --git a/components/browser_sync/browser/profile_sync_service.cc b/components/browser_sync/browser/profile_sync_service.cc |
index 5f0c8da7319e3d3b01d721f4aeec014651e682a5..95a951dfedc552f8a56d2297eb16ad4dba80a54d 100644 |
--- a/components/browser_sync/browser/profile_sync_service.cc |
+++ b/components/browser_sync/browser/profile_sync_service.cc |
@@ -1528,19 +1528,15 @@ |
return !IsFirstSetupComplete() && startup_controller_->IsSetupInProgress(); |
} |
-std::unique_ptr<sync_driver::SyncSetupInProgressHandle> |
-ProfileSyncService::GetSetupInProgressHandle() { |
- if (++outstanding_setup_in_progress_handles_ == 1) { |
- DCHECK(!startup_controller_->IsSetupInProgress()); |
- startup_controller_->SetSetupInProgress(true); |
- |
- NotifyObservers(); |
- } |
- |
- return std::unique_ptr<sync_driver::SyncSetupInProgressHandle>( |
- new sync_driver::SyncSetupInProgressHandle( |
- base::Bind(&ProfileSyncService::OnSetupInProgressHandleDestroyed, |
- weak_factory_.GetWeakPtr()))); |
+void ProfileSyncService::SetSetupInProgress(bool setup_in_progress) { |
+ // This method is a no-op if |setup_in_progress_| remains unchanged. |
+ if (startup_controller_->IsSetupInProgress() == setup_in_progress) |
+ return; |
+ |
+ startup_controller_->SetSetupInProgress(setup_in_progress); |
+ if (!setup_in_progress && IsBackendInitialized()) |
+ ReconfigureDatatypeManager(); |
+ NotifyObservers(); |
} |
bool ProfileSyncService::IsSyncAllowed() const { |
@@ -2548,18 +2544,3 @@ |
const { |
return unrecoverable_error_location_; |
} |
- |
-void ProfileSyncService::OnSetupInProgressHandleDestroyed() { |
- DCHECK_GT(outstanding_setup_in_progress_handles_, 0); |
- |
- // Don't re-start Sync until all outstanding handles are destroyed. |
- if (--outstanding_setup_in_progress_handles_ != 0) |
- return; |
- |
- DCHECK(startup_controller_->IsSetupInProgress()); |
- startup_controller_->SetSetupInProgress(false); |
- |
- if (IsBackendInitialized()) |
- ReconfigureDatatypeManager(); |
- NotifyObservers(); |
-} |