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

Side by Side 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: Rename in backend as well 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 unified diff | Download patch
« no previous file with comments | « sync/sessions/model_type_registry.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "sync/syncable/model_neutral_mutable_entry.h" 5 #include "sync/syncable/model_neutral_mutable_entry.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "sync/internal_api/public/base/unique_position.h" 9 #include "sync/internal_api/public/base/unique_position.h"
10 #include "sync/syncable/directory.h" 10 #include "sync/syncable/directory.h"
(...skipping 30 matching lines...) Expand all
41 } 41 }
42 trans->TrackChangesTo(kernel.get()); 42 trans->TrackChangesTo(kernel.get());
43 43
44 kernel_ = kernel.release(); 44 kernel_ = kernel.release();
45 } 45 }
46 46
47 ModelNeutralMutableEntry::ModelNeutralMutableEntry(BaseWriteTransaction* trans, 47 ModelNeutralMutableEntry::ModelNeutralMutableEntry(BaseWriteTransaction* trans,
48 CreateNewTypeRoot, 48 CreateNewTypeRoot,
49 ModelType type) 49 ModelType type)
50 : Entry(trans), base_write_transaction_(trans) { 50 : Entry(trans), base_write_transaction_(trans) {
51 DCHECK(IsTypeWithClientGeneratedRoot(type)); 51 // We allow NIGORI because we allow SyncEncryptionHandler to restore a nigori
52 // across Directory instances (see SyncEncryptionHandler::RestoreNigori).
53 if (type != NIGORI)
54 DCHECK(IsTypeWithClientGeneratedRoot(type));
52 Entry same_type_root(trans, GET_TYPE_ROOT, type); 55 Entry same_type_root(trans, GET_TYPE_ROOT, type);
53 kernel_ = NULL; 56 kernel_ = NULL;
54 if (same_type_root.good()) { 57 if (same_type_root.good()) {
55 return; // already have a type root for the given type 58 return; // already have a type root for the given type
56 } 59 }
57 60
58 scoped_ptr<EntryKernel> kernel(new EntryKernel()); 61 scoped_ptr<EntryKernel> kernel(new EntryKernel());
59 62
60 sync_pb::EntitySpecifics specifics; 63 sync_pb::EntitySpecifics specifics;
61 AddDefaultFieldValue(type, &specifics); 64 AddDefaultFieldValue(type, &specifics);
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 ModelNeutralMutableEntry::ModelNeutralMutableEntry(BaseWriteTransaction* trans) 435 ModelNeutralMutableEntry::ModelNeutralMutableEntry(BaseWriteTransaction* trans)
433 : Entry(trans), base_write_transaction_(trans) {} 436 : Entry(trans), base_write_transaction_(trans) {}
434 437
435 MetahandleSet* ModelNeutralMutableEntry::GetDirtyIndexHelper() { 438 MetahandleSet* ModelNeutralMutableEntry::GetDirtyIndexHelper() {
436 return &dir()->kernel()->dirty_metahandles; 439 return &dir()->kernel()->dirty_metahandles;
437 } 440 }
438 441
439 } // namespace syncable 442 } // namespace syncable
440 443
441 } // namespace syncer 444 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/sessions/model_type_registry.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698