summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-22 10:56:25 +0000
committerzea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-22 10:56:25 +0000
commitc649d52d0c673eae23af01f266ae8c657d8e8fd7 (patch)
treebd4f1b23e70c8f2522ecb0b7561d369f8c13bb22
parent15e7b6c7f10e09714e47179015acce8ba87164e8 (diff)
downloadchromium_src-c649d52d0c673eae23af01f266ae8c657d8e8fd7.zip
chromium_src-c649d52d0c673eae23af01f266ae8c657d8e8fd7.tar.gz
chromium_src-c649d52d0c673eae23af01f266ae8c657d8e8fd7.tar.bz2
[Sync] Ensure encryption happens before syncing with the server.
BUG=108105 TEST= Review URL: http://codereview.chromium.org/9017033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115514 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/sync/profile_sync_service.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc
index 012c516..4ca5215 100644
--- a/chrome/browser/sync/profile_sync_service.cc
+++ b/chrome/browser/sync/profile_sync_service.cc
@@ -1393,17 +1393,20 @@ void ProfileSyncService::Observe(int type,
DCHECK(!(IsPassphraseRequiredForDecryption() &&
!IsEncryptedDatatypeEnabled()));
- // 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();
-
+ // This must be done before we start syncing with the server to avoid
+ // sending unencrypted data up on a first time sync.
if (!encryption_pending_) {
wizard_.Step(SyncSetupWizard::DONE);
NotifyObservers();
} else {
backend_->EnableEncryptEverything();
}
+
+ // 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();
+
break;
}
case chrome::NOTIFICATION_GOOGLE_SIGNIN_FAILED: {