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

Unified Diff: sync/engine/commit_util.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 | « no previous file | sync/engine/directory_update_handler_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/engine/commit_util.cc
diff --git a/sync/engine/commit_util.cc b/sync/engine/commit_util.cc
index c913edd11108c99e159fee7a7ad6536356facf1d..a40870320f003da48e9ce9096fc1edc628daa910 100644
--- a/sync/engine/commit_util.cc
+++ b/sync/engine/commit_util.cc
@@ -150,11 +150,11 @@ void BuildCommitItem(
// TODO(nick): With the server keeping track of the primary sync parent,
// it should not be necessary to provide the old_parent_id: the version
// number should suffice.
- if (new_parent_id != meta_entry.GetServerParentId() &&
+ Id server_parent_id = meta_entry.GetServerParentId();
+ if (new_parent_id != server_parent_id && !server_parent_id.IsNull() &&
0 != meta_entry.GetBaseVersion() &&
syncable::CHANGES_VERSION != meta_entry.GetBaseVersion()) {
- sync_entry->set_old_parent_id(
- SyncableIdToProto(meta_entry.GetServerParentId()));
+ sync_entry->set_old_parent_id(SyncableIdToProto(server_parent_id));
}
int64 version = meta_entry.GetBaseVersion();
@@ -184,7 +184,7 @@ void BuildCommitItem(
// for legacy reasons. See comments in sync.proto for more information.
const Id& prev_id = meta_entry.GetPredecessorId();
string prev_id_string =
- prev_id.IsRoot() ? string() : prev_id.GetServerId();
+ prev_id.IsNull() ? string() : prev_id.GetServerId();
sync_entry->set_insert_after_item_id(prev_id_string);
sync_entry->set_position_in_parent(
meta_entry.GetUniquePosition().ToInt64());
« no previous file with comments | « no previous file | sync/engine/directory_update_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698