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

Unified Diff: sync/syncable/mutable_entry.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/syncable/entry_kernel.h ('k') | sync/syncable/nigori_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/syncable/mutable_entry.cc
diff --git a/sync/syncable/mutable_entry.cc b/sync/syncable/mutable_entry.cc
index 0aa37e7a4df1369cb2ad2e91cdd3c36fe39eb358..0cc06f90b69ea8524d301c9b8f238f8697534693 100644
--- a/sync/syncable/mutable_entry.cc
+++ b/sync/syncable/mutable_entry.cc
@@ -227,10 +227,14 @@ void MutableEntry::PutUniquePosition(const UniquePosition& value) {
}
bool MutableEntry::PutPredecessor(const Id& predecessor_id) {
- MutableEntry predecessor(write_transaction(), GET_BY_ID, predecessor_id);
- if (!predecessor.good())
- return false;
- dir()->PutPredecessor(kernel_, predecessor.kernel_);
+ if (predecessor_id.IsNull()) {
+ dir()->PutPredecessor(kernel_, NULL);
+ } else {
+ MutableEntry predecessor(write_transaction(), GET_BY_ID, predecessor_id);
+ if (!predecessor.good())
+ return false;
+ dir()->PutPredecessor(kernel_, predecessor.kernel_);
+ }
return true;
}
« no previous file with comments | « sync/syncable/entry_kernel.h ('k') | sync/syncable/nigori_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698