Chromium Code Reviews| 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_ENGINE_DIRECTORY_CRYPTOGRAPHER_PROVIDER_H_ | |
| 6 #define SYNC_ENGINE_DIRECTORY_CRYPTOGRAPHER_PROVIDER_H_ | |
| 7 | |
| 8 #include "sync/engine/cryptographer_provider.h" | |
| 9 | |
| 10 #include "sync/syncable/syncable_read_transaction.h" | |
| 11 | |
| 12 namespace syncer { | |
| 13 | |
| 14 namespace syncable { | |
| 15 class Directory; | |
| 16 } | |
| 17 | |
| 18 // Provides access to the Directory's cryptographer through the | |
| 19 // CryptographerProvider interface. | |
| 20 class DirectoryCryptographerProvider : public CryptographerProvider { | |
| 21 public: | |
| 22 DirectoryCryptographerProvider(syncable::Directory* dir); | |
| 23 virtual ~DirectoryCryptographerProvider(); | |
| 24 | |
| 25 virtual bool InitScopedCryptographerRef( | |
| 26 ScopedCryptographerRef* scoped) OVERRIDE; | |
| 27 | |
| 28 private: | |
| 29 syncable::Directory* dir_; | |
| 30 }; | |
| 31 | |
| 32 // An implementation detail of the DirectoryCryptographerProvider. Contains | |
| 33 // the ReadTransaction used to safely access the Cryptographer. | |
| 34 class ScopedDirectoryCryptographerImpl : public ScopedCryptographerImpl { | |
|
Nicolas Zea
2014/07/25 20:03:30
Along the lines of the previous naming suggestion,
| |
| 35 public: | |
| 36 ScopedDirectoryCryptographerImpl(syncable::Directory* dir); | |
| 37 virtual ~ScopedDirectoryCryptographerImpl(); | |
| 38 | |
| 39 virtual Cryptographer* Get() const OVERRIDE; | |
| 40 | |
| 41 private: | |
| 42 syncable::Directory* dir_; | |
| 43 syncable::ReadTransaction trans_; | |
| 44 | |
| 45 DISALLOW_COPY_AND_ASSIGN(ScopedDirectoryCryptographerImpl); | |
| 46 }; | |
| 47 | |
| 48 } // namespace syncer | |
| 49 | |
| 50 #endif // SYNC_ENGINE_DIRECTORY_CRYPTOGRAPHER_PROVIDER_H_ | |
| OLD | NEW |