Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(286)

Unified Diff: chrome/browser/sync/profile_sync_service.cc

Issue 10167017: Fix some migration-related bugs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix unit tests Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/profile_sync_service.cc
diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc
index 27e3e56c5779796467e6867e98bb9a811fe4d154..c687fc537524bb3121cf6610feaa0249e969f09f 100644
--- a/chrome/browser/sync/profile_sync_service.cc
+++ b/chrome/browser/sync/profile_sync_service.cc
@@ -1457,10 +1457,15 @@ void ProfileSyncService::Observe(int type,
backend_->EnableEncryptEverything();
NotifyObservers();
- // In the old world, this would be a no-op. With new syncer thread,
- // this is the point where it is safe to switch from config-mode to
- // normal operation.
- backend_->StartSyncingWithServer();
+ if (migrator_.get() &&
+ migrator_->state() != browser_sync::BackendMigrator::IDLE) {
+ // Migration in progress. Let the migrator know we just finished
+ // configuring something. It will be up to the migrator to call
+ // StartSyncingWithServer() if migration is now finished.
+ migrator_->OnConfigureDone(*result);
+ } else {
+ StartSyncingWithServer();
+ }
break;
}
@@ -1543,6 +1548,11 @@ void ProfileSyncService::Observe(int type,
}
}
+void ProfileSyncService::StartSyncingWithServer() {
+ if (backend_.get())
+ backend_->StartSyncingWithServer();
+}
+
void ProfileSyncService::AddObserver(Observer* observer) {
observers_.AddObserver(observer);
}

Powered by Google App Engine
This is Rietveld 408576698