Index: chrome/browser/sync/syncable/syncable.h |
diff --git a/chrome/browser/sync/syncable/syncable.h b/chrome/browser/sync/syncable/syncable.h |
index ba4611559fc5a6ddc7df6dfb7c81967df855e3cf..90f9def6488acf82f105b47699d38d4b2f421fe5 100644 |
--- a/chrome/browser/sync/syncable/syncable.h |
+++ b/chrome/browser/sync/syncable/syncable.h |
@@ -791,6 +791,12 @@ class Directory { |
const std::string& dir_name, |
const FilePath& backing_filepath); |
+ // Update this directory's set of encrypted datatypes. |
+ // Note: |types| should be a complete set of all datatypes that require |
+ // encryption, not just a subset. This does not actually perform any |
+ // encryption or modify the Nigori node. |
+ void SetEncryptedDataTypes(const ModelTypeSet& encrypted_types); |
+ |
private: |
// These private versions expect the kernel lock to already be held |
// before calling. |
@@ -1021,6 +1027,12 @@ class Directory { |
// The next metahandle is protected by kernel mutex. |
int64 next_metahandle; |
+ // The set of all datatypes that currently require encryption. This is |
+ // set when we load the nigori node and modified anytime we either receive |
+ // a change to the nigori node or through the local user changing the |
+ // encryption status. |
+ ModelTypeSet encrypted_datatypes; |
tim (not reviewing)
2011/02/11 06:52:31
Why do we store this in 3 places again? The fact
Nicolas Zea
2011/02/14 21:18:41
Done.
|
+ |
// Keep a history of recently flushed metahandles for debugging |
// purposes. Protected by the save_changes_mutex. |
DebugQueue<int64, 1000> flushed_metahandles; |
@@ -1048,8 +1060,18 @@ class BaseTransaction { |
inline Directory* directory() const { return directory_; } |
inline Id root_id() const { return Id(); } |
+ inline const ModelTypeSet& GetEncryptedDatatypes() { |
+ return dirkernel_->encrypted_datatypes; |
+ } |
+ |
virtual ~BaseTransaction(); |
+ // Update this transaction's directory's set of encrypted datatypes. |
+ // Note: |encrypted_types| should be a complete set of all datatypes that |
+ // require encryption, not just a subset. This does not actually perform any |
+ // encryption or modify the Nigori node. |
+ void SetEncryptedDataTypes(const ModelTypeSet& encrypted_types); |
tim (not reviewing)
2011/02/11 06:52:31
Why have get/set operations on the transaction whe
Nicolas Zea
2011/02/14 21:18:41
Done.
|
+ |
protected: |
BaseTransaction(Directory* directory, const char* name, |
const char* source_file, int line, WriterTag writer); |