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

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

Issue 6537027: Revert 75287 - [Sync] Initial support for encrypting any datatype (no UI hook... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 10 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_harness.cc
===================================================================
--- chrome/browser/sync/profile_sync_service_harness.cc (revision 75295)
+++ chrome/browser/sync/profile_sync_service_harness.cc (working copy)
@@ -84,8 +84,7 @@
const std::string& username,
const std::string& password,
int id)
- : waiting_for_encryption_type_(syncable::UNSPECIFIED),
- wait_state_(INITIAL_WAIT_STATE),
+ : wait_state_(INITIAL_WAIT_STATE),
profile_(profile),
service_(NULL),
timestamp_match_partner_(NULL),
@@ -289,14 +288,6 @@
LogClientInfo("SYNC_DISABLED");
break;
}
- case WAITING_FOR_ENCRYPTION: {
- // If the type whose encryption we are waiting for is now complete, there
- // is nothing to do.
- LogClientInfo("WAITING_FOR_ENCRYPTION");
- if (IsTypeEncrypted(waiting_for_encryption_type_))
- SignalStateCompleteWithNextState(FULLY_SYNCED);
- break;
- }
default:
// Invalid state during observer callback which may be triggered by other
// classes using the the UI message loop. Defer to their handling.
@@ -606,36 +597,3 @@
<< ": Sync service not available.";
}
}
-
-bool ProfileSyncServiceHarness::EnableEncryptionForType(
- syncable::ModelType type) {
- syncable::ModelTypeSet encrypted_types;
- service_->GetEncryptedDataTypes(&encrypted_types);
- if (encrypted_types.count(type) > 0)
- return true;
- encrypted_types.insert(type);
- service_->EncryptDataTypes(encrypted_types);
-
- // Wait some time to let the enryption finish.
- std::string reason = "Waiting for encryption.";
- DCHECK_EQ(FULLY_SYNCED, wait_state_);
- wait_state_ = WAITING_FOR_ENCRYPTION;
- waiting_for_encryption_type_ = type;
- if (!AwaitStatusChangeWithTimeout(kLiveSyncOperationTimeoutMs, reason)) {
- LOG(ERROR) << "Did not receive EncryptionComplete notification after"
- << kLiveSyncOperationTimeoutMs / 1000
- << " seconds.";
- return false;
- }
-
- return IsTypeEncrypted(type);
-}
-
-bool ProfileSyncServiceHarness::IsTypeEncrypted(syncable::ModelType type) {
- syncable::ModelTypeSet encrypted_types;
- service_->GetEncryptedDataTypes(&encrypted_types);
- if (encrypted_types.count(type) == 0) {
- return false;
- }
- return true;
-}
« no previous file with comments | « chrome/browser/sync/profile_sync_service_harness.h ('k') | chrome/browser/sync/profile_sync_service_session_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698