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

Unified Diff: sync/test/fake_sync_encryption_handler.cc

Issue 10878015: [Sync] Move keystore key handling to SyncEncryptionHandlerImpl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 4 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 | « sync/test/fake_sync_encryption_handler.h ('k') | sync/util/cryptographer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/test/fake_sync_encryption_handler.cc
diff --git a/sync/test/fake_sync_encryption_handler.cc b/sync/test/fake_sync_encryption_handler.cc
index fd41a5c0ba2d96549464e0613c3be01343844b8f..1dbdf8b75861c3fe6ad930af409cb9971622903f 100644
--- a/sync/test/fake_sync_encryption_handler.cc
+++ b/sync/test/fake_sync_encryption_handler.cc
@@ -57,6 +57,25 @@ void FakeSyncEncryptionHandler::UpdateNigoriFromEncryptedTypes(
nigori);
}
+bool FakeSyncEncryptionHandler::NeedKeystoreKey(
+ syncable::BaseTransaction* const trans) const {
+ return keystore_key_.empty();
+}
+
+bool FakeSyncEncryptionHandler::SetKeystoreKey(
+ const std::string& key,
+ syncable::BaseTransaction* const trans) {
+ if (!keystore_key_.empty() || key.empty())
+ return false;
+ keystore_key_ = key;
+
+ DVLOG(1) << "Keystore bootstrap token updated.";
+ FOR_EACH_OBSERVER(SyncEncryptionHandler::Observer, observers_,
+ OnBootstrapTokenUpdated(key,
+ KEYSTORE_BOOTSTRAP_TOKEN));
+ return true;
+}
+
ModelTypeSet FakeSyncEncryptionHandler::GetEncryptedTypes(
syncable::BaseTransaction* const trans) const {
return encrypted_types_;
« no previous file with comments | « sync/test/fake_sync_encryption_handler.h ('k') | sync/util/cryptographer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698