summaryrefslogtreecommitdiffstats
path: root/sync/engine/process_commit_response_command.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sync/engine/process_commit_response_command.cc')
-rw-r--r--sync/engine/process_commit_response_command.cc14
1 files changed, 10 insertions, 4 deletions
diff --git a/sync/engine/process_commit_response_command.cc b/sync/engine/process_commit_response_command.cc
index 2f84619..200a710 100644
--- a/sync/engine/process_commit_response_command.cc
+++ b/sync/engine/process_commit_response_command.cc
@@ -22,6 +22,11 @@
#include "sync/syncable/write_transaction.h"
#include "sync/util/time.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::set;
using std::string;
using std::vector;
@@ -45,7 +50,7 @@ using syncable::IS_UNSYNCED;
using syncable::PARENT_ID;
using syncable::SERVER_IS_DEL;
using syncable::SERVER_PARENT_ID;
-using syncable::SERVER_POSITION_IN_PARENT;
+using syncable::SERVER_ORDINAL_IN_PARENT;
using syncable::SERVER_VERSION;
using syncable::SYNCER;
using syncable::SYNCING;
@@ -368,8 +373,9 @@ void ProcessCommitResponseCommand::UpdateServerFieldsAfterCommit(
ProtoTimeToTime(committed_entry.mtime()));
local_entry->Put(syncable::SERVER_CTIME,
ProtoTimeToTime(committed_entry.ctime()));
- local_entry->Put(syncable::SERVER_POSITION_IN_PARENT,
- entry_response.position_in_parent());
+ local_entry->Put(syncable::SERVER_ORDINAL_IN_PARENT,
+ Int64ToNodeOrdinal(entry_response.position_in_parent()));
+
// TODO(nick): The server doesn't set entry_response.server_parent_id in
// practice; to update SERVER_PARENT_ID appropriately here we'd need to
// get the post-commit ID of the parent indicated by
@@ -417,7 +423,7 @@ void ProcessCommitResponseCommand::OverrideClientFieldsAfterCommit(
if (entry_response.has_position_in_parent()) {
// The SERVER_ field should already have been written.
DCHECK_EQ(entry_response.position_in_parent(),
- local_entry->Get(SERVER_POSITION_IN_PARENT));
+ NodeOrdinalToInt64(local_entry->Get(SERVER_ORDINAL_IN_PARENT)));
// We just committed successfully, so we assume that the position
// value we got applies to the PARENT_ID we submitted.