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

Unified Diff: sync/test/fake_sync_encryption_handler.h

Issue 10844005: [Sync] Refactor GetEncryptedTypes usage. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + add dcheck 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/engine/test_directory_setter_upper.cc ('k') | sync/test/fake_sync_encryption_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/test/fake_sync_encryption_handler.h
diff --git a/sync/test/fake_sync_encryption_handler.h b/sync/test/fake_sync_encryption_handler.h
index 83a2e63a3f2a9851c4fe5a0f882e494bd6c5c1ee..7456a0829e73b2c13dd1dfc32cbc2a94e719ffcd 100644
--- a/sync/test/fake_sync_encryption_handler.h
+++ b/sync/test/fake_sync_encryption_handler.h
@@ -11,11 +11,11 @@
#include "base/observer_list.h"
#include "sync/internal_api/public/sync_encryption_handler.h"
#include "sync/syncable/nigori_handler.h"
+#include "sync/test/fake_encryptor.h"
+#include "sync/util/cryptographer.h"
namespace syncer {
-class Cryptographer;
-
// A fake sync encryption handler capable of keeping track of the encryption
// state without opening any transactions or interacting with the nigori node.
// Note that this only performs basic interactions with the cryptographer
@@ -28,10 +28,6 @@ class FakeSyncEncryptionHandler : public SyncEncryptionHandler,
FakeSyncEncryptionHandler();
virtual ~FakeSyncEncryptionHandler();
- void set_cryptographer(Cryptographer* cryptographer) {
- cryptographer_ = cryptographer;
- }
-
// SyncEncryptionHandler implementation.
virtual void AddObserver(Observer* observer) OVERRIDE;
virtual void RemoveObserver(Observer* observer) OVERRIDE;
@@ -47,10 +43,13 @@ class FakeSyncEncryptionHandler : public SyncEncryptionHandler,
virtual void ApplyNigoriUpdate(
const sync_pb::NigoriSpecifics& nigori,
syncable::BaseTransaction* const trans) OVERRIDE;
- virtual ModelTypeSet GetEncryptedTypes() const OVERRIDE;
virtual void UpdateNigoriFromEncryptedTypes(
sync_pb::NigoriSpecifics* nigori,
syncable::BaseTransaction* const trans) const OVERRIDE;
+ virtual ModelTypeSet GetEncryptedTypes(
+ syncable::BaseTransaction* const trans) const OVERRIDE;
+
+ Cryptographer* cryptographer() { return &cryptographer_; }
private:
ObserverList<SyncEncryptionHandler::Observer> observers_;
@@ -58,7 +57,8 @@ class FakeSyncEncryptionHandler : public SyncEncryptionHandler,
bool encrypt_everything_;
bool explicit_passphrase_;
- Cryptographer* cryptographer_;
+ FakeEncryptor encryptor_;
+ Cryptographer cryptographer_;
};
} // namespace syncer
« no previous file with comments | « sync/test/engine/test_directory_setter_upper.cc ('k') | sync/test/fake_sync_encryption_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698