| OLD | NEW |
| (Empty) |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef SYNC_TEST_ENGINE_SIMPLE_CRYPTOGRAPHER_PROVIDER_H_ | |
| 6 #define SYNC_TEST_ENGINE_SIMPLE_CRYPTOGRAPHER_PROVIDER_H_ | |
| 7 | |
| 8 #include "sync/engine/cryptographer_provider.h" | |
| 9 | |
| 10 #include "sync/util/cryptographer.h" | |
| 11 | |
| 12 namespace syncer { | |
| 13 | |
| 14 // A trivial cryptographer provider. Exposes the given Cryptographer through | |
| 15 // the CryptographerProvider interface. Does not take ownership of the | |
| 16 // |cryptographer|. | |
| 17 class SimpleCryptographerProvider : public CryptographerProvider { | |
| 18 public: | |
| 19 explicit SimpleCryptographerProvider(Cryptographer* cryptographer); | |
| 20 virtual ~SimpleCryptographerProvider(); | |
| 21 | |
| 22 // Implementation of CryptographerProvider. | |
| 23 virtual bool InitScopedCryptographerRef( | |
| 24 ScopedCryptographerRef* scoped) OVERRIDE; | |
| 25 | |
| 26 private: | |
| 27 Cryptographer* cryptographer_; | |
| 28 }; | |
| 29 | |
| 30 class SimpleScopedCryptographerInternal : public ScopedCryptographerInternal { | |
| 31 public: | |
| 32 explicit SimpleScopedCryptographerInternal(Cryptographer* cryptographer); | |
| 33 virtual ~SimpleScopedCryptographerInternal(); | |
| 34 | |
| 35 // Implementation of ScopedCryptographerInternal. | |
| 36 virtual Cryptographer* Get() const OVERRIDE; | |
| 37 | |
| 38 private: | |
| 39 Cryptographer* cryptographer_; | |
| 40 }; | |
| 41 | |
| 42 } // namespace syncer | |
| 43 | |
| 44 #endif // SYNC_TEST_ENGINE_SIMPLE_CRYPTOGRAPHER_PROVIDER_H_ | |
| OLD | NEW |