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

Unified Diff: sync/engine/syncer_proto_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
« no previous file with comments | « sync/engine/syncer_proto_util.h ('k') | sync/engine/syncer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/engine/syncer_proto_util.cc
diff --git a/sync/engine/syncer_proto_util.cc b/sync/engine/syncer_proto_util.cc
index 15ab92e1b48c297777000a0a29be7b16b1239425..4befc97b4b77512ed51d5c506e6531fa41e18962 100644
--- a/sync/engine/syncer_proto_util.cc
+++ b/sync/engine/syncer_proto_util.cc
@@ -534,6 +534,14 @@ bool SyncerProtoUtil::ShouldMaintainPosition(
}
// static
+bool SyncerProtoUtil::ShouldMaintainHierarchy(
+ const sync_pb::SyncEntity& sync_entity) {
+ // Maintain hierarchy for bookmarks or top-level items.
+ return GetModelType(sync_entity) == BOOKMARKS ||
+ sync_entity.parent_id_string() == "0";
Nicolas Zea 2015/07/29 17:58:09 nit: why check parent id string rather than model
stanisc 2015/07/29 21:37:07 This is for compatibility with some tests that cre
+}
+
+// static
const std::string& SyncerProtoUtil::NameFromSyncEntity(
const sync_pb::SyncEntity& entry) {
if (entry.has_non_unique_name())
« no previous file with comments | « sync/engine/syncer_proto_util.h ('k') | sync/engine/syncer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698