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

Unified Diff: sync/syncable/directory.h

Issue 10844005: [Sync] Refactor GetEncryptedTypes usage. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Always trigger OnEncryptedTypesChanged on init Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
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_;
};

Powered by Google App Engine
This is Rietveld 408576698