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

Unified Diff: sync/engine/syncer_util.cc

Issue 1246063003: Sync: Don't set/use Parent ID for non-hierarchical sync data types. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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/engine/syncer_util.cc
diff --git a/sync/engine/syncer_util.cc b/sync/engine/syncer_util.cc
index 3a8870017c554dad472e42ab26ca04564faaa10e..5577e0b8f225a2a0c8fe6c6b36266dd795589655 100644
--- a/sync/engine/syncer_util.cc
+++ b/sync/engine/syncer_util.cc
@@ -406,7 +406,11 @@ void UpdateServerFieldsFromUpdate(
DCHECK_EQ(target->GetId(), SyncableIdFromProto(update.id_string()))
<< "ID Changing not supported here";
- target->PutServerParentId(SyncableIdFromProto(update.parent_id_string()));
+ if (SyncerProtoUtil::ShouldMaintainHierarchy(update)) {
+ target->PutServerParentId(SyncableIdFromProto(update.parent_id_string()));
+ } else {
+ target->PutServerParentId(syncable::Id());
+ }
target->PutServerNonUniqueName(name);
target->PutServerVersion(update.version());
target->PutServerCtime(ProtoTimeToTime(update.ctime()));

Powered by Google App Engine
This is Rietveld 408576698