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

Unified Diff: sync/engine/syncer_util.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 | « sync/engine/syncer_unittest.cc ('k') | sync/syncable/directory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/engine/syncer_util.cc
diff --git a/sync/engine/syncer_util.cc b/sync/engine/syncer_util.cc
index 0dad3f8c367c9aa240ced2b0a48ffd0b345da7c1..cdc1b7a965da9ee380c735c964a04f4a16bd2c3c 100644
--- a/sync/engine/syncer_util.cc
+++ b/sync/engine/syncer_util.cc
@@ -29,6 +29,11 @@
#include "sync/util/cryptographer.h"
#include "sync/util/time.h"
+// TODO(vishwath): Remove this include after node positions have
+// shifted to completely uing Ordinals.
+// See http://crbug.com/145412 .
+#include "sync/internal_api/public/base/node_ordinal.h"
+
namespace syncer {
using syncable::BASE_VERSION;
@@ -58,7 +63,7 @@ using syncable::SERVER_IS_DIR;
using syncable::SERVER_MTIME;
using syncable::SERVER_NON_UNIQUE_NAME;
using syncable::SERVER_PARENT_ID;
-using syncable::SERVER_POSITION_IN_PARENT;
+using syncable::SERVER_ORDINAL_IN_PARENT;
using syncable::SERVER_SPECIFICS;
using syncable::SERVER_VERSION;
using syncable::UNIQUE_CLIENT_TAG;
@@ -351,7 +356,8 @@ void UpdateServerFieldsFromUpdate(
target);
}
if (update.has_position_in_parent())
- target->Put(SERVER_POSITION_IN_PARENT, update.position_in_parent());
+ target->Put(SERVER_ORDINAL_IN_PARENT,
+ Int64ToNodeOrdinal(update.position_in_parent()));
target->Put(SERVER_IS_DEL, update.deleted());
// We only mark the entry as unapplied if its version is greater than the
« no previous file with comments | « sync/engine/syncer_unittest.cc ('k') | sync/syncable/directory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698