summaryrefslogtreecommitdiffstats
path: root/sync/protocol
diff options
context:
space:
mode:
Diffstat (limited to 'sync/protocol')
-rw-r--r--sync/protocol/sync.proto14
-rw-r--r--sync/protocol/sync_proto.gyp1
-rw-r--r--sync/protocol/unique_position.proto28
3 files changed, 34 insertions, 9 deletions
diff --git a/sync/protocol/sync.proto b/sync/protocol/sync.proto
index 6aea1d0..0dafdc4 100644
--- a/sync/protocol/sync.proto
+++ b/sync/protocol/sync.proto
@@ -38,6 +38,7 @@ import "sync_enums.proto";
import "synced_notification_specifics.proto";
import "theme_specifics.proto";
import "typed_url_specifics.proto";
+import "unique_position.proto";
// Used for inspecting how long we spent performing operations in different
// backends. All times must be in millis.
@@ -332,14 +333,6 @@ message SyncEntity {
// This is the fourth attempt at positioning.
//
- // Unique positions are unique per-item, since they are guaranteed to end with
- // a fixed-length suffix that is unique per-item. The position string may not
- // end with a '\0' byte.
- //
- // Prior to the suffix is a series of arbitrary bytes of arbitrary length.
- // Items under the same parent are positioned relative to each other by a
- // lexicographic comparison of their UniquePosition values.
- //
// This field is present in both GetUpdatesResponse and CommitMessage, if the
// item's type requires it and the client that wrote the item supports it (M26
// or higher). Clients must also be prepared to handle updates from clients
@@ -349,7 +342,10 @@ message SyncEntity {
// This field will not be set for items whose type ignores positioning.
// Clients should not attempt to read this field on the receipt of an item of
// a type that ignores positioning.
- optional bytes unique_position = 25;
+ //
+ // Refer to its definition in unique_position.proto for more information about
+ // its internal representation.
+ optional UniquePosition unique_position = 25;
};
// This message contains diagnostic information used to correlate
diff --git a/sync/protocol/sync_proto.gyp b/sync/protocol/sync_proto.gyp
index 4745044..31d717f 100644
--- a/sync/protocol/sync_proto.gyp
+++ b/sync/protocol/sync_proto.gyp
@@ -37,6 +37,7 @@
'test.proto',
'theme_specifics.proto',
'typed_url_specifics.proto',
+ 'unique_position.proto',
],
'variables': {
'proto_out_dir': 'sync/protocol',
diff --git a/sync/protocol/unique_position.proto b/sync/protocol/unique_position.proto
new file mode 100644
index 0000000..c074312
--- /dev/null
+++ b/sync/protocol/unique_position.proto
@@ -0,0 +1,28 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+// Protobuf representation of the UniquePosition class.
+
+// Update proto_value_conversions{.h,.cc,_unittest.cc} if you change
+// any fields in this file.
+
+syntax = "proto2";
+
+option optimize_for = LITE_RUNTIME;
+option retain_unknown_fields = true;
+
+package sync_pb;
+
+// A UniquePosition is a string of bytes.
+//
+// Unique positions are unique per-item, since they are guaranteed to end with a
+// fixed-length suffix that is unique per-item. The position string may not end
+// with a '\0' byte.
+//
+// Prior to the suffix is a series of arbitrary bytes of arbitrary length.
+// Items under the same parent are positioned relative to each other by a
+// lexicographic comparison of their UniquePosition values.
+message UniquePosition {
+ optional bytes value = 1;
+}