Index: sync/syncable/directory.h |
diff --git a/sync/syncable/directory.h b/sync/syncable/directory.h |
index 5cf6d55f712891619fcd48f65a2383291dd66803..b34882feb40ee319598b8832109ccc05e4704478 100644 |
--- a/sync/syncable/directory.h |
+++ b/sync/syncable/directory.h |
@@ -17,21 +17,21 @@ |
#include "sync/syncable/entry_kernel.h" |
#include "sync/syncable/metahandle_set.h" |
#include "sync/syncable/scoped_kernel_lock.h" |
-#include "sync/util/cryptographer.h" |
namespace syncer { |
-class Encryptor; |
+class Cryptographer; |
class UnrecoverableErrorHandler; |
namespace syncable { |
+class BaseTransaction; |
class DirectoryChangeDelegate; |
+class DirectoryBackingStore; |
+class NigoriHandler; |
+class ScopedKernelLock; |
class TransactionObserver; |
-class BaseTransaction; |
class WriteTransaction; |
-class ScopedKernelLock; |
-class DirectoryBackingStore; |
// How syncable indices & Indexers work. |
// |
@@ -207,11 +207,12 @@ class Directory { |
// |report_unrecoverable_error_function| may be NULL. |
// Takes ownership of |store|. |
Directory( |
- Encryptor* encryptor, |
+ DirectoryBackingStore* store, |
UnrecoverableErrorHandler* unrecoverable_error_handler, |
ReportUnrecoverableErrorFunction |
report_unrecoverable_error_function, |
- DirectoryBackingStore* store); |
+ NigoriHandler* nigori_handler, |
+ Cryptographer* cryptographer); |
virtual ~Directory(); |
// Does not take ownership of |delegate|, which must not be NULL. |
@@ -265,9 +266,11 @@ class Directory { |
// Unique to each account / client pair. |
std::string cache_guid() const; |
- // Returns a pointer to our cryptographer. Does not transfer ownership. The |
- // cryptographer is not thread safe; it should not be accessed after the |
- // transaction has been released. |
+ // Returns a pointer to our Nigori node handler. |
+ NigoriHandler* GetNigoriHandler(); |
+ |
+ // Returns a pointer to our cryptographer. Does not transfer ownership. |
+ // Not thread safe, so should only be accessed while holding a transaction. |
Cryptographer* GetCryptographer(const BaseTransaction* trans); |
// Returns true if the directory had encountered an unrecoverable error. |
@@ -592,8 +595,6 @@ class Directory { |
EntryKernel* GetPossibleFirstChild( |
const ScopedKernelLock& lock, const Id& parent_id); |
- Cryptographer cryptographer_; |
- |
Kernel* kernel_; |
scoped_ptr<DirectoryBackingStore> store_; |
@@ -602,6 +603,10 @@ class Directory { |
const ReportUnrecoverableErrorFunction report_unrecoverable_error_function_; |
bool unrecoverable_error_set_; |
+ // Not owned. |
+ NigoriHandler* const nigori_handler_; |
+ Cryptographer* const cryptographer_; |
+ |
InvariantCheckLevel invariant_check_level_; |
}; |