From 8d4ff17dc2992c6d2c6130b06d246b9e707cf0e4 Mon Sep 17 00:00:00 2001 From: "tim@chromium.org" Date: Wed, 23 Apr 2014 08:53:37 +0000 Subject: sync: always send entity specifics with bookmark tombstones BUG=365752 Review URL: https://codereview.chromium.org/248053002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@265587 0039d316-1c4b-4281-b951-d872f2087c98 --- sync/engine/commit_util.cc | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'sync/engine') diff --git a/sync/engine/commit_util.cc b/sync/engine/commit_util.cc index 1081446..45bc2bb 100644 --- a/sync/engine/commit_util.cc +++ b/sync/engine/commit_util.cc @@ -158,11 +158,11 @@ void BuildCommitItem( sync_entry->set_ctime(TimeToProtoTime(meta_entry.GetCtime())); sync_entry->set_mtime(TimeToProtoTime(meta_entry.GetMtime())); - // Deletion is final on the server, let's move things and then delete them. - if (meta_entry.GetIsDel()) { - sync_entry->set_deleted(true); - } else { - if (meta_entry.GetSpecifics().has_bookmark()) { + // Handle bookmarks separately. + if (meta_entry.GetSpecifics().has_bookmark()) { + if (meta_entry.GetIsDel()) { + sync_entry->set_deleted(true); + } else { // Both insert_after_item_id and position_in_parent fields are set only // for legacy reasons. See comments in sync.proto for more information. const Id& prev_id = meta_entry.GetPredecessorId(); @@ -174,10 +174,18 @@ void BuildCommitItem( meta_entry.GetUniquePosition().ToProto( sync_entry->mutable_unique_position()); } + // Always send specifics for bookmarks. SetEntrySpecifics(meta_entry, sync_entry); + return; } -} + // Deletion is final on the server, let's move things and then delete them. + if (meta_entry.GetIsDel()) { + sync_entry->set_deleted(true); + } else { + SetEntrySpecifics(meta_entry, sync_entry); + } +} // Helpers for ProcessSingleCommitResponse. namespace { -- cgit v1.1