| Index: sync/engine/directory_cryptographer_provider.h
|
| diff --git a/sync/engine/directory_cryptographer_provider.h b/sync/engine/directory_cryptographer_provider.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..6bf54a653896a004dfca44488f2bbecec197f48d
|
| --- /dev/null
|
| +++ b/sync/engine/directory_cryptographer_provider.h
|
| @@ -0,0 +1,49 @@
|
| +// 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_ENGINE_DIRECTORY_CRYPTOGRAPHER_PROVIDER_H_
|
| +#define SYNC_ENGINE_DIRECTORY_CRYPTOGRAPHER_PROVIDER_H_
|
| +
|
| +#include "sync/engine/cryptographer_provider.h"
|
| +
|
| +#include "sync/syncable/syncable_read_transaction.h"
|
| +
|
| +namespace syncer {
|
| +
|
| +namespace syncable {
|
| +class Directory;
|
| +}
|
| +
|
| +// Provides access to the Directory's cryptographer through the
|
| +// CryptographerProvider interface.
|
| +class DirectoryCryptographerProvider : public CryptographerProvider {
|
| + public:
|
| + DirectoryCryptographerProvider(syncable::Directory* dir);
|
| + virtual ~DirectoryCryptographerProvider();
|
| +
|
| + virtual bool InitScopedCryptographer(ScopedCryptographer* scoped) OVERRIDE;
|
| +
|
| + private:
|
| + syncable::Directory* dir_;
|
| +};
|
| +
|
| +// An implementation detail of the DirectoryCryptographerProvider. Contains
|
| +// the ReadTransaction used to safely access the Cryptographer.
|
| +class ScopedDirectoryCryptographerImpl : public ScopedCryptographerImpl {
|
| + public:
|
| + ScopedDirectoryCryptographerImpl(syncable::Directory* dir);
|
| + virtual ~ScopedDirectoryCryptographerImpl();
|
| +
|
| + virtual Cryptographer* Get() const OVERRIDE;
|
| +
|
| + private:
|
| + syncable::Directory* dir_;
|
| + syncable::ReadTransaction trans_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(ScopedDirectoryCryptographerImpl);
|
| +};
|
| +
|
| +} // namespace syncer
|
| +
|
| +#endif // SYNC_ENGINE_DIRECTORY_CRYPTOGRAPHER_PROVIDER_H_
|
|
|