summaryrefslogtreecommitdiffstats
path: root/sync/internal_api/sync_encryption_handler_impl.h
diff options
context:
space:
mode:
authorzea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-26 11:54:26 +0000
committerzea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-26 11:54:26 +0000
commit25ae16e2002fa7b2da8803d0690c44c9c5d5d355 (patch)
tree1971d53e29559a49ba3266adf6cd27f158bf7171 /sync/internal_api/sync_encryption_handler_impl.h
parent225b6d78753087dbd3ca0c2aa8a985109ef2fb1a (diff)
downloadchromium_src-25ae16e2002fa7b2da8803d0690c44c9c5d5d355.zip
chromium_src-25ae16e2002fa7b2da8803d0690c44c9c5d5d355.tar.gz
chromium_src-25ae16e2002fa7b2da8803d0690c44c9c5d5d355.tar.bz2
[Sync] Refactor passphrase state handling
We now have an enum describing passphrase state, and cache the current value on the UI thread via a new OnPassphraseStateChanged method. Additionally, we log the OnPassphraseStateChanged event in the debug log info. BUG=139848, 129665 Review URL: https://chromiumcodereview.appspot.com/10824410 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@153397 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/internal_api/sync_encryption_handler_impl.h')
-rw-r--r--sync/internal_api/sync_encryption_handler_impl.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/sync/internal_api/sync_encryption_handler_impl.h b/sync/internal_api/sync_encryption_handler_impl.h
index 8966da7..8f3b7ac 100644
--- a/sync/internal_api/sync_encryption_handler_impl.h
+++ b/sync/internal_api/sync_encryption_handler_impl.h
@@ -57,9 +57,7 @@ class SyncEncryptionHandlerImpl
virtual void SetDecryptionPassphrase(const std::string& passphrase) OVERRIDE;
virtual void EnableEncryptEverything() OVERRIDE;
virtual bool EncryptEverythingEnabled() const OVERRIDE;
- // Can be called from any thread.
- // TODO(zea): enforce this is only called on sync thread.
- virtual bool IsUsingExplicitPassphrase() const OVERRIDE;
+ virtual PassphraseState GetPassphraseState() const OVERRIDE;
// NigoriHandler implementation.
// Note: all methods are invoked while the caller holds a transaction.
@@ -180,8 +178,9 @@ class SyncEncryptionHandlerImpl
// thread.
// Whether all current and future types should be encrypted.
bool encrypt_everything_;
- // Whether the user is using a custom passphrase for encryption.
- bool explicit_passphrase_;
+ // The current state of the passphrase required to decrypt the encryption
+ // keys stored in the nigori node.
+ PassphraseState passphrase_state_;
// The number of times we've automatically (i.e. not via SetPassphrase or
// conflict resolver) updated the nigori's encryption keys in this chrome