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

Unified Diff: sync/engine/syncer.cc

Issue 10989063: Changed DB to store node positions as Ordinals. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Ordinal default ctor now creates invalid Ordinals 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
Index: sync/engine/syncer.cc
diff --git a/sync/engine/syncer.cc b/sync/engine/syncer.cc
index adb34b48eda0990b58030aab37b69c01f998d5c7..643395fe94f952c4a0d81f8d4e77a723d56b2865 100644
--- a/sync/engine/syncer.cc
+++ b/sync/engine/syncer.cc
@@ -27,6 +27,11 @@
#include "sync/syncable/mutable_entry.h"
#include "sync/syncable/syncable-inl.h"
+//TODO(vishwath): Remove this include after node positions have
akalin 2012/10/05 22:40:27 space after //
vishwath 2012/10/08 20:17:49 Done.
+// shifted to completely using Ordinals.
+// See http://crbug.com/145412 .
+#include "sync/internal_api/public/base/node_ordinal.h"
+
using base::Time;
using base::TimeDelta;
using sync_pb::ClientCommand;
@@ -44,7 +49,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;
@@ -242,7 +247,7 @@ void CopyServerFields(syncable::Entry* src, syncable::MutableEntry* dest) {
dest->Put(SERVER_IS_DEL, src->Get(SERVER_IS_DEL));
dest->Put(IS_UNAPPLIED_UPDATE, src->Get(IS_UNAPPLIED_UPDATE));
dest->Put(SERVER_SPECIFICS, src->Get(SERVER_SPECIFICS));
- dest->Put(SERVER_POSITION_IN_PARENT, src->Get(SERVER_POSITION_IN_PARENT));
+ dest->Put(SERVER_ORDINAL_IN_PARENT, src->Get(SERVER_ORDINAL_IN_PARENT));
}
void ClearServerData(syncable::MutableEntry* entry) {
@@ -255,7 +260,7 @@ void ClearServerData(syncable::MutableEntry* entry) {
entry->Put(SERVER_IS_DEL, false);
entry->Put(IS_UNAPPLIED_UPDATE, false);
entry->Put(SERVER_SPECIFICS, sync_pb::EntitySpecifics::default_instance());
- entry->Put(SERVER_POSITION_IN_PARENT, 0);
+ entry->Put(SERVER_ORDINAL_IN_PARENT, Int64ToNodeOrdinal(0));
}
} // namespace syncer

Powered by Google App Engine
This is Rietveld 408576698