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

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

Issue 7492044: During SetupSync, check for missing passphrase before waiting for sync (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix indent Created 9 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/profile_sync_service_harness.cc
diff --git a/chrome/browser/sync/profile_sync_service_harness.cc b/chrome/browser/sync/profile_sync_service_harness.cc
index 135eaf795e1b5faeaa51d12107326392fa1fdf8b..a1c7a3039463b47f5fe3e3c7b57b0186e608872c 100644
--- a/chrome/browser/sync/profile_sync_service_harness.cc
+++ b/chrome/browser/sync/profile_sync_service_harness.cc
@@ -174,6 +174,13 @@ bool ProfileSyncServiceHarness::SetupSync(
(syncable::MODEL_TYPE_COUNT - syncable::FIRST_REAL_MODEL_TYPE));
service()->OnUserChoseDatatypes(sync_everything, synced_datatypes);
+ // Make sure that a partner client hasn't already set an explicit passphrase.
+ if (wait_state_ == SET_PASSPHRASE_FAILED) {
+ LOG(ERROR) << "A passphrase is required for decryption. Sync cannot proceed"
+ " until SetPassphrase is called.";
+ return false;
+ }
+
// Wait for initial sync cycle to be completed.
DCHECK_EQ(wait_state_, WAITING_FOR_INITIAL_SYNC);
if (!AwaitStatusChangeWithTimeout(kLiveSyncOperationTimeoutMs,
@@ -184,12 +191,6 @@ bool ProfileSyncServiceHarness::SetupSync(
return false;
}
- if (wait_state_ == SET_PASSPHRASE_FAILED) {
- LOG(ERROR) << "A passphrase is required for decryption. Sync cannot proceed"
- " until SetPassphrase is called.";
- return false;
- }
-
// Indicate to the browser that sync setup is complete.
service()->SetSyncSetupCompleted();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698