From c649d52d0c673eae23af01f266ae8c657d8e8fd7 Mon Sep 17 00:00:00 2001 From: "zea@chromium.org" Date: Thu, 22 Dec 2011 10:56:25 +0000 Subject: [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 --- chrome/browser/sync/profile_sync_service.cc | 13 ++++++++----- 1 file 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: { -- cgit v1.1