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

Unified Diff: sync/syncable/entry_kernel.h

Issue 11636006: WIP: The Bookmark Position Megapatch (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Various updates, including switch suffix to unique_client_tag style Created 8 years 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/syncable/entry.cc ('k') | sync/syncable/entry_kernel.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/syncable/entry_kernel.h
diff --git a/sync/syncable/entry_kernel.h b/sync/syncable/entry_kernel.h
index 77ad87ddbc5f238981d694f354da0d3884392a55..b9c01e21a3fa2e113fdc05c3bc16737c932a7838 100644
--- a/sync/syncable/entry_kernel.h
+++ b/sync/syncable/entry_kernel.h
@@ -8,7 +8,7 @@
#include "base/time.h"
#include "base/values.h"
#include "sync/internal_api/public/base/model_type.h"
-#include "sync/internal_api/public/base/node_ordinal.h"
+#include "sync/internal_api/public/base/unique_position.h"
#include "sync/internal_api/public/util/immutable.h"
#include "sync/protocol/sync.pb.h"
#include "sync/syncable/metahandle_set.h"
@@ -80,9 +80,6 @@ enum IdField {
ID = ID_FIELDS_BEGIN,
PARENT_ID,
SERVER_PARENT_ID,
-
- PREV_ID,
- NEXT_ID,
ID_FIELDS_END
};
@@ -143,21 +140,32 @@ enum ProtoField {
enum {
PROTO_FIELDS_COUNT = PROTO_FIELDS_END - PROTO_FIELDS_BEGIN,
- ORDINAL_FIELDS_BEGIN = PROTO_FIELDS_END
+ UNIQUE_POSITION_FIELDS_BEGIN = PROTO_FIELDS_END
+};
+
+enum UniquePositionField {
+ SERVER_UNIQUE_POSITION = UNIQUE_POSITION_FIELDS_BEGIN,
+ UNIQUE_POSITION,
+ UNIQUE_POSITION_FIELDS_END
+};
+
+enum {
+ UNIQUE_POSITION_FIELDS_COUNT =
+ UNIQUE_POSITION_FIELDS_END - UNIQUE_POSITION_FIELDS_BEGIN,
+ BYTES_FIELDS_BEGIN = UNIQUE_POSITION_FIELDS_END
};
-enum OrdinalField {
- // An Ordinal that identifies the relative ordering of this object
- // among its siblings.
- SERVER_ORDINAL_IN_PARENT = ORDINAL_FIELDS_BEGIN,
- ORDINAL_FIELDS_END
+enum BytesField {
+ // A unique tag for bookmarks.
+ UNIQUE_BOOKMARK_TAG = BYTES_FIELDS_BEGIN,
+ BYTES_FIELDS_END
};
enum {
- ORDINAL_FIELDS_COUNT = ORDINAL_FIELDS_END - ORDINAL_FIELDS_BEGIN,
- FIELD_COUNT = ORDINAL_FIELDS_END - BEGIN_FIELDS,
+ BYTES_FIELDS_COUNT = BYTES_FIELDS_END - BYTES_FIELDS_BEGIN,
+ FIELD_COUNT = BYTES_FIELDS_END - BEGIN_FIELDS,
// Past this point we have temporaries, stored in memory only.
- BEGIN_TEMPS = ORDINAL_FIELDS_END,
+ BEGIN_TEMPS = BYTES_FIELDS_END,
BIT_TEMPS_BEGIN = BEGIN_TEMPS,
};
@@ -181,7 +189,8 @@ struct EntryKernel {
int64 int64_fields[INT64_FIELDS_COUNT];
base::Time time_fields[TIME_FIELDS_COUNT];
Id id_fields[ID_FIELDS_COUNT];
- NodeOrdinal ordinal_fields[ORDINAL_FIELDS_COUNT];
+ std::string bytes_fields[BYTES_FIELDS_COUNT];
+ UniquePosition unique_position_fields[UNIQUE_POSITION_FIELDS_COUNT];
std::bitset<BIT_FIELDS_COUNT> bit_fields;
std::bitset<BIT_TEMPS_COUNT> bit_temps;
@@ -249,8 +258,11 @@ struct EntryKernel {
inline void put(ProtoField field, const sync_pb::EntitySpecifics& value) {
specifics_fields[field - PROTO_FIELDS_BEGIN].CopyFrom(value);
}
- inline void put(OrdinalField field, const NodeOrdinal& value) {
- ordinal_fields[field - ORDINAL_FIELDS_BEGIN] = value;
+ inline void put(UniquePositionField field, const UniquePosition& value) {
+ unique_position_fields[field - UNIQUE_POSITION_FIELDS_BEGIN] = value;
+ }
+ inline void put(BytesField field, const std::string& value) {
+ bytes_fields[field - BYTES_FIELDS_BEGIN] = value;
}
inline void put(BitTemp field, bool value) {
bit_temps[field - BIT_TEMPS_BEGIN] = value;
@@ -287,8 +299,11 @@ struct EntryKernel {
inline const sync_pb::EntitySpecifics& ref(ProtoField field) const {
return specifics_fields[field - PROTO_FIELDS_BEGIN];
}
- inline const NodeOrdinal& ref(OrdinalField field) const {
- return ordinal_fields[field - ORDINAL_FIELDS_BEGIN];
+ inline const UniquePosition& ref(UniquePositionField field) const {
+ return unique_position_fields[field - UNIQUE_POSITION_FIELDS_BEGIN];
+ }
+ inline const std::string& ref(BytesField field) const {
+ return bytes_fields[field - BYTES_FIELDS_BEGIN];
}
inline bool ref(BitTemp field) const {
return bit_temps[field - BIT_TEMPS_BEGIN];
@@ -304,10 +319,11 @@ struct EntryKernel {
inline Id& mutable_ref(IdField field) {
return id_fields[field - ID_FIELDS_BEGIN];
}
- inline NodeOrdinal& mutable_ref(OrdinalField field) {
- return ordinal_fields[field - ORDINAL_FIELDS_BEGIN];
+ inline UniquePosition& mutable_ref(UniquePositionField field) {
+ return unique_position_fields[field - UNIQUE_POSITION_FIELDS_BEGIN];
}
+ ModelType GetModelType() const;
ModelType GetServerModelType() const;
// Dumps all kernel info into a DictionaryValue and returns it.
« no previous file with comments | « sync/syncable/entry.cc ('k') | sync/syncable/entry_kernel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698