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

Unified Diff: sync/syncable/model_neutral_mutable_entry.cc

Issue 1177853002: [Sync] Add ability to save/restore Nigori to SyncEncryptionHandlerImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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/model_neutral_mutable_entry.cc
diff --git a/sync/syncable/model_neutral_mutable_entry.cc b/sync/syncable/model_neutral_mutable_entry.cc
index a7beadcaf1356817d606be29bd05985f8bcec44f..b4b88d1a2eb22c24147208215afcfd22c26a7fbc 100644
--- a/sync/syncable/model_neutral_mutable_entry.cc
+++ b/sync/syncable/model_neutral_mutable_entry.cc
@@ -48,7 +48,10 @@ ModelNeutralMutableEntry::ModelNeutralMutableEntry(BaseWriteTransaction* trans,
CreateNewTypeRoot,
ModelType type)
: Entry(trans), base_write_transaction_(trans) {
- DCHECK(IsTypeWithClientGeneratedRoot(type));
+ // We allow NIGORI because we allow SyncEncryptionHandler to restore a nigori
+ // across Directory instances (see SyncEncryptionHandler::RestoreNigori).
+ if (type != NIGORI)
+ DCHECK(IsTypeWithClientGeneratedRoot(type));
Entry same_type_root(trans, GET_TYPE_ROOT, type);
kernel_ = NULL;
if (same_type_root.good()) {

Powered by Google App Engine
This is Rietveld 408576698