Chromium Code Reviews| 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_ |