diff options
author | zea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-17 19:36:38 +0000 |
---|---|---|
committer | zea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-17 19:36:38 +0000 |
commit | 6d6f2034c50dd574c36547527b707753ebe196e3 (patch) | |
tree | 2e56a9830f36ac2560ac2c9f933d06a4a82f9d8e /chrome/browser/sync/profile_sync_service_harness.cc | |
parent | eeeb25e6a364cd50fe3298486a45cdce5db558c3 (diff) | |
download | chromium_src-6d6f2034c50dd574c36547527b707753ebe196e3.zip chromium_src-6d6f2034c50dd574c36547527b707753ebe196e3.tar.gz chromium_src-6d6f2034c50dd574c36547527b707753ebe196e3.tar.bz2 |
Revert 75287 - [Sync] Initial support for encrypting any datatype (no UI hookup yet).
BUG=59242
TEST=unit,sync_unit,sync_integration
Review URL: http://codereview.chromium.org/6465005
TBR=zea@chromium.org
Review URL: http://codereview.chromium.org/6537027
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75297 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sync/profile_sync_service_harness.cc')
-rw-r--r-- | chrome/browser/sync/profile_sync_service_harness.cc | 44 |
1 files changed, 1 insertions, 43 deletions
diff --git a/chrome/browser/sync/profile_sync_service_harness.cc b/chrome/browser/sync/profile_sync_service_harness.cc index 72bb584d..95eaff1 100644 --- a/chrome/browser/sync/profile_sync_service_harness.cc +++ b/chrome/browser/sync/profile_sync_service_harness.cc @@ -84,8 +84,7 @@ ProfileSyncServiceHarness::ProfileSyncServiceHarness( 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 @@ bool ProfileSyncServiceHarness::RunStateChangeMachine() { 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 @@ void ProfileSyncServiceHarness::LogClientInfo(std::string message) { << ": 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; -} |