diff options
author | tim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-23 08:53:37 +0000 |
---|---|---|
committer | tim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-23 08:53:37 +0000 |
commit | 8d4ff17dc2992c6d2c6130b06d246b9e707cf0e4 (patch) | |
tree | ec94d21cdc17923fff223e2795a00e1871a15c04 /sync | |
parent | 403ba24ab5939c0381b2b12f33daabf586856071 (diff) | |
download | chromium_src-8d4ff17dc2992c6d2c6130b06d246b9e707cf0e4.zip chromium_src-8d4ff17dc2992c6d2c6130b06d246b9e707cf0e4.tar.gz chromium_src-8d4ff17dc2992c6d2c6130b06d246b9e707cf0e4.tar.bz2 |
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
Diffstat (limited to 'sync')
-rw-r--r-- | sync/engine/commit_util.cc | 20 | ||||
-rw-r--r-- | sync/protocol/sync.proto | 2 |
2 files changed, 15 insertions, 7 deletions
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 { diff --git a/sync/protocol/sync.proto b/sync/protocol/sync.proto index 675c25b..1e9b66a 100644 --- a/sync/protocol/sync.proto +++ b/sync/protocol/sync.proto @@ -692,7 +692,7 @@ message DataTypeContext { message ClientToServerMessage { required string share = 1; - optional int32 protocol_version = 2 [default = 31]; + optional int32 protocol_version = 2 [default = 32]; enum Contents { COMMIT = 1; GET_UPDATES = 2; |