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

Side by Side Diff: sync/engine/directory_cryptographer_provider.h

Issue 413833002: sync: Introduce CryptographerProvider interface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Typo fix and small cleanup 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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 InitScopedCryptographer(ScopedCryptographer* scoped) OVERRIDE;
26
27 private:
28 syncable::Directory* dir_;
29 };
30
31 // An implementation detail of the DirectoryCryptographerProvider. Contains
32 // the ReadTransaction used to safely access the Cryptographer.
33 class ScopedDirectoryCryptographerImpl : public ScopedCryptographerImpl {
34 public:
35 ScopedDirectoryCryptographerImpl(syncable::Directory* dir);
36 virtual ~ScopedDirectoryCryptographerImpl();
37
38 virtual Cryptographer* Get() const OVERRIDE;
39
40 private:
41 syncable::Directory* dir_;
42 syncable::ReadTransaction trans_;
43
44 DISALLOW_COPY_AND_ASSIGN(ScopedDirectoryCryptographerImpl);
45 };
46
47 } // namespace syncer
48
49 #endif // SYNC_ENGINE_DIRECTORY_CRYPTOGRAPHER_PROVIDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698