| Index: sync/engine/process_updates_command.cc
|
| diff --git a/sync/engine/process_updates_command.cc b/sync/engine/process_updates_command.cc
|
| index 15a14cb54cc64e7bb517e7c6e4dff8ec53886c15..ccf85c703f2c4bdcae186af42c31691589b67034 100644
|
| --- a/sync/engine/process_updates_command.cc
|
| +++ b/sync/engine/process_updates_command.cc
|
| @@ -19,11 +19,6 @@
|
| #include "sync/syncable/write_transaction.h"
|
| #include "sync/util/cryptographer.h"
|
|
|
| -// TODO(vishwath): Remove this include after node positions have
|
| -// shifted to completely using Ordinals.
|
| -// See http://crbug.com/145412 .
|
| -#include "sync/internal_api/public/base/node_ordinal.h"
|
| -
|
| using std::vector;
|
|
|
| namespace syncer {
|
| @@ -314,12 +309,23 @@ ServerUpdateProcessingResult ProcessUpdatesCommand::ProcessUpdate(
|
| // (on which any current or future local changes are based) before we
|
| // overwrite SERVER_SPECIFICS.
|
| // MTIME, CTIME, and NON_UNIQUE_NAME are not enforced.
|
| +
|
| + bool position_matches = true;
|
| + if (target_entry.GetModelType() == BOOKMARKS && !update.deleted()) {
|
| + std::string update_tag = GetUniqueBookmarkTagFromUpdate(update);
|
| + if (UniquePosition::IsValidSuffix(update_tag)) {
|
| + position_matches = GetUpdatePosition(update, update_tag).Equals(
|
| + target_entry.Get(syncable::SERVER_UNIQUE_POSITION));
|
| + } else {
|
| + NOTREACHED();
|
| + position_matches = false;
|
| + }
|
| + }
|
| +
|
| if (!update.deleted() && !target_entry.Get(syncable::SERVER_IS_DEL) &&
|
| (SyncableIdFromProto(update.parent_id_string()) ==
|
| target_entry.Get(syncable::SERVER_PARENT_ID)) &&
|
| - (update.position_in_parent() ==
|
| - NodeOrdinalToInt64(
|
| - target_entry.Get(syncable::SERVER_ORDINAL_IN_PARENT))) &&
|
| + position_matches &&
|
| update.has_specifics() && update.specifics().has_encrypted() &&
|
| !cryptographer->CanDecrypt(update.specifics().encrypted())) {
|
| sync_pb::EntitySpecifics prev_specifics =
|
|
|