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

Unified Diff: sync/test/engine/simple_cryptographer_provider.h

Issue 413833002: sync: Introduce CryptographerProvider interface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: s/ScopedCryptographer/ScopedCryptographerRef/ Created 6 years, 5 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: sync/test/engine/simple_cryptographer_provider.h
diff --git a/sync/test/engine/simple_cryptographer_provider.h b/sync/test/engine/simple_cryptographer_provider.h
new file mode 100644
index 0000000000000000000000000000000000000000..a1216db801f9c8ba2e73817c00eeaec16acb9546
--- /dev/null
+++ b/sync/test/engine/simple_cryptographer_provider.h
@@ -0,0 +1,44 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SYNC_TEST_ENGINE_SIMPLE_CRYPTOGRAPHER_PROVIDER_H_
+#define SYNC_TEST_ENGINE_SIMPLE_CRYPTOGRAPHER_PROVIDER_H_
+
+#include "sync/engine/cryptographer_provider.h"
+
+#include "sync/util/cryptographer.h"
+
+namespace syncer {
+
+// A trivial cryptographer provider. Exposes the given Cryptographer through
+// the CryptographerProvider interface. Does not take ownership of the
+// |cryptographer|.
+class SimpleCryptographerProvider : public CryptographerProvider {
+ public:
+ explicit SimpleCryptographerProvider(Cryptographer* cryptographer);
+ virtual ~SimpleCryptographerProvider();
+
+ // Implementation of CryptographerProvider.
+ virtual bool InitScopedCryptographerRef(
+ ScopedCryptographerRef* scoped) OVERRIDE;
+
+ private:
+ Cryptographer* cryptographer_;
+};
+
+class SimpleScopedCryptographerImpl : public ScopedCryptographerImpl {
Nicolas Zea 2014/07/25 20:03:31 SimpleCryptographerGetter?
+ public:
+ explicit SimpleScopedCryptographerImpl(Cryptographer* cryptographer);
+ virtual ~SimpleScopedCryptographerImpl();
+
+ // Implementation of ScopedCryptographerImpl.
+ virtual Cryptographer* Get() const OVERRIDE;
+
+ private:
+ Cryptographer* cryptographer_;
+};
+
+} // namespace syncer
+
+#endif // SYNC_TEST_ENGINE_SIMPLE_CRYPTOGRAPHER_PROVIDER_H_

Powered by Google App Engine
This is Rietveld 408576698