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

Unified Diff: sync/syncable/directory.cc

Issue 805633004: Enable Null Syncable ID which is different than Root ID. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed CR feedback Created 6 years 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
« no previous file with comments | « sync/internal_api/write_node.cc ('k') | sync/syncable/directory_backing_store.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/syncable/directory.cc
diff --git a/sync/syncable/directory.cc b/sync/syncable/directory.cc
index 9c59409372474942afd800d686704473b6abca11..22c3f461d8cad21688f0aa679c9d50d546db4a1a 100644
--- a/sync/syncable/directory.cc
+++ b/sync/syncable/directory.cc
@@ -1192,6 +1192,7 @@ bool Directory::CheckTreeInvariants(syncable::BaseTransaction* trans,
trans))
return false;
int safety_count = handles.size() + 1;
+ // TODO(stanisc): handle items with Null parentid
while (!parentid.IsRoot()) {
Entry parent(trans, GET_BY_ID, parentid);
if (!SyncAssert(parent.good(), FROM_HERE,
@@ -1392,13 +1393,13 @@ void Directory::PutPredecessor(EntryKernel* e, EntryKernel* predecessor) {
if (!siblings) {
// This parent currently has no other children.
- DCHECK(predecessor->ref(ID).IsRoot());
+ DCHECK(predecessor == NULL);
UniquePosition pos = UniquePosition::InitialPosition(suffix);
e->put(UNIQUE_POSITION, pos);
return;
}
- if (predecessor->ref(ID).IsRoot()) {
+ if (predecessor == NULL) {
// We have at least one sibling, and we're inserting to the left of them.
UniquePosition successor_pos = (*siblings->begin())->ref(UNIQUE_POSITION);
« no previous file with comments | « sync/internal_api/write_node.cc ('k') | sync/syncable/directory_backing_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698