Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Unified Diff: sync/engine/build_commit_command.cc

Issue 10989063: Changed DB to store node positions as Ordinals. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixed memory leak error in unittest Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sync/engine/process_commit_response_command.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/engine/build_commit_command.cc
diff --git a/sync/engine/build_commit_command.cc b/sync/engine/build_commit_command.cc
index 8e51ddb530a0e8a49072c5157285bf08413f2468..bfa5b9c18e04331fa809830e50a828eda76bc308 100644
--- a/sync/engine/build_commit_command.cc
+++ b/sync/engine/build_commit_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;
@@ -31,7 +36,7 @@ namespace syncer {
using sessions::SyncSession;
using syncable::Entry;
using syncable::IS_DEL;
-using syncable::SERVER_POSITION_IN_PARENT;
+using syncable::SERVER_ORDINAL_IN_PARENT;
using syncable::IS_UNAPPLIED_UPDATE;
using syncable::IS_UNSYNCED;
using syncable::Id;
@@ -231,7 +236,7 @@ int64 BuildCommitCommand::FindAnchorPosition(syncable::IdField direction,
syncable::GET_BY_ID,
next_id);
if (!next_entry.Get(IS_UNSYNCED) && !next_entry.Get(IS_UNAPPLIED_UPDATE)) {
- return next_entry.Get(SERVER_POSITION_IN_PARENT);
+ return NodeOrdinalToInt64(next_entry.Get(SERVER_ORDINAL_IN_PARENT));
}
next_id = next_entry.Get(direction);
}
« no previous file with comments | « no previous file | sync/engine/process_commit_response_command.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698