summaryrefslogtreecommitdiffstats
path: root/sync/engine/process_updates_command.cc
diff options
context:
space:
mode:
authorvishwath@google.com <vishwath@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-09 02:40:35 +0000
committervishwath@google.com <vishwath@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-09 02:40:35 +0000
commit49c24fe8219c35d947e061c2d6aa102f8b04928a (patch)
treec9e1c6e436f4de1009e0428c5af3f3f5cb7f6c3d /sync/engine/process_updates_command.cc
parent01fda60d8a2ddcf7e317675364872fbe697fdb54 (diff)
downloadchromium_src-49c24fe8219c35d947e061c2d6aa102f8b04928a.zip
chromium_src-49c24fe8219c35d947e061c2d6aa102f8b04928a.tar.gz
chromium_src-49c24fe8219c35d947e061c2d6aa102f8b04928a.tar.bz2
Changed DB to store node positions as Ordinals.
As part of the effort to move away from int64 based node positions, changed the DB to store server_position_in_node as an ordinal (represented by a varchar) instead. Also updated unittests and the latest db version number (now at 81). BUG=145412 Review URL: https://chromiumcodereview.appspot.com/10989063 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@160774 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/engine/process_updates_command.cc')
-rw-r--r--sync/engine/process_updates_command.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/sync/engine/process_updates_command.cc b/sync/engine/process_updates_command.cc
index de6be0f..0bf03f1 100644
--- a/sync/engine/process_updates_command.cc
+++ b/sync/engine/process_updates_command.cc
@@ -19,6 +19,11 @@
#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 {
@@ -152,7 +157,8 @@ ServerUpdateProcessingResult ProcessUpdatesCommand::ProcessUpdate(
(SyncableIdFromProto(update.parent_id_string()) ==
target_entry.Get(syncable::SERVER_PARENT_ID)) &&
(update.position_in_parent() ==
- target_entry.Get(syncable::SERVER_POSITION_IN_PARENT)) &&
+ NodeOrdinalToInt64(
+ target_entry.Get(syncable::SERVER_ORDINAL_IN_PARENT))) &&
update.has_specifics() && update.specifics().has_encrypted() &&
!cryptographer->CanDecrypt(update.specifics().encrypted())) {
sync_pb::EntitySpecifics prev_specifics =