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

Side by Side Diff: sync/protocol/sync.proto

Issue 9369005: [Sync] Add ordinal_in_parent to SyncEntity/CommitResponse protobuf (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 8 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // Sync protocol for communication between sync client and server. 5 // Sync protocol for communication between sync client and server.
6 6
7 // Update proto_value_conversions{.h,.cc,_unittest.cc} if you change 7 // Update proto_value_conversions{.h,.cc,_unittest.cc} if you change
8 // any fields in this file. 8 // any fields in this file.
9 9
10 syntax = "proto2"; 10 syntax = "proto2";
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 // Supplies a numeric position for this item, relative to other items with 208 // Supplies a numeric position for this item, relative to other items with
209 // the same parent. 209 // the same parent.
210 // 210 //
211 // Present in both GetUpdatesResponse and CommitMessage. 211 // Present in both GetUpdatesResponse and CommitMessage.
212 // 212 //
213 // In a CommitMessage context, server implementations may choose whether 213 // In a CommitMessage context, server implementations may choose whether
214 // to compute a position based on this field or based on 214 // to compute a position based on this field or based on
215 // |insert_after_item_id|. Clients should set both values so that they 215 // |insert_after_item_id|. Clients should set both values so that they
216 // result in a consistent ordering regardless of which choice the server 216 // result in a consistent ordering regardless of which choice the server
217 // makes. 217 // makes.
218 //
219 // This is deprecated: clients should set |ordinal_in_parent|
220 // instead. But until the production servers fully support
221 // |ordinal_in_parent|, clients should set all three position fields
222 // (|position_in_parent|, |insert_after_item_id|, and
223 // |ordinal_in_parent| in commits) and continue to respect any
224 // |position_in_parent| values returned by CommitResponses.
225 //
226 // Similarly, when |ordinal_in_parent| is absent in a GetUpdates and
227 // |position_in_parent| is present, clients should continue to honor
228 // the |position_in_parent| value (after transforming it as
229 // described below).
230 //
231 // When both |ordinal_in_parent| and |position_in_parent| are set,
232 // the first 8 bytes of |ordinal_in_parent| must be equal to the
233 // bytes of flip-sign-bit(|position_in_parent|) in big-endian order
234 // (MSB first), and if those bytes are all zero, a 9th byte equal to
235 // 128 must be added.
218 optional int64 position_in_parent = 15; 236 optional int64 position_in_parent = 15;
219 237
220 // Contains the ID of the element (under the same parent) after which this 238 // Contains the ID of the element (under the same parent) after which this
221 // element resides. An empty string indicates that the element is the first 239 // element resides. An empty string indicates that the element is the first
222 // element in the parent. This value is used during commits to specify 240 // element in the parent. This value is used during commits to specify
223 // a relative position for a position change. In the context of 241 // a relative position for a position change. In the context of
224 // a GetUpdatesMessage, |position_in_parent| is used instead to 242 // a GetUpdatesMessage, |position_in_parent| is used instead to
225 // communicate position. 243 // communicate position.
226 // 244 //
227 // Present only in CommitMessage. 245 // Present only in CommitMessage.
228 // 246 // This is deprecated: see comment for |position_in_parent| above.
229 // This is being deprecated: clients should now explicitly set
230 // an absolute |position_in_parent| value at commit time. In the
231 // interim, clients should supply both values and continue to honor
232 // the |position_in_parent| value returned in the CommitResponse.
233 optional string insert_after_item_id = 16; 247 optional string insert_after_item_id = 16;
234 248
235 // Arbitrary key/value pairs associated with this item. 249 // Arbitrary key/value pairs associated with this item.
236 // Present in both GetUpdatesResponse and CommitMessage. 250 // Present in both GetUpdatesResponse and CommitMessage.
237 // Deprecated. 251 // Deprecated.
238 // optional ExtendedAttributes extended_attributes = 17; 252 // optional ExtendedAttributes extended_attributes = 17;
239 253
240 // If true, indicates that this item has been (or should be) deleted. 254 // If true, indicates that this item has been (or should be) deleted.
241 // Present in both GetUpdatesResponse and CommitMessage. 255 // Present in both GetUpdatesResponse and CommitMessage.
242 optional bool deleted = 18 [default = false]; 256 optional bool deleted = 18 [default = false];
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 // c) Client tag - If client committed the item as unique 297 // c) Client tag - If client committed the item as unique
284 // 298 //
285 // May be present in CommitMessages for the initial creation of an entity. 299 // May be present in CommitMessages for the initial creation of an entity.
286 // If present in Commit updates for the entity, it will be ignored. 300 // If present in Commit updates for the entity, it will be ignored.
287 // 301 //
288 // Available in version 24+. 302 // Available in version 24+.
289 // 303 //
290 // May be returned in GetUpdatesMessage and sent up in CommitMessage. 304 // May be returned in GetUpdatesMessage and sent up in CommitMessage.
291 // 305 //
292 optional string client_defined_unique_tag = 23; 306 optional string client_defined_unique_tag = 23;
307
308 // Supplies an ordinal for this item, relative to other items with the
309 // same parent. Ordinals are ordered lexicographically bytewise.
310 // Ordinals must be a least 8 bytes (for backwards compatibility), and
311 // must not be all zeroes.
312 //
313 // Clients should not make sure that each item they know of has a
314 // unique ordinal-in-parent. However, updates from the server might
315 // break this invariant. In that case, among the items with the
316 // same ordinal-in-parent, a client should randomly pick one, and
317 // then perturb the ordinal-in-parents of all the other ones (within
318 // the bounds of the preceding and succeeding ordinal-in-parent)
319 // until they're unique; a byte of randomness per item should be
320 // more than enough.
321 //
322 // Available in version 31+.
323 //
324 // Present in both GetUpdatesResponse and CommitMessage.
325 //
326 // In a CommitMessage context, server implementations may choose whether
327 // to compute a position based on this field, |position_in_parent|, or
328 // |insert_after_item_id|. Clients should set all values so that they
329 // result in a consistent ordering regardless of which choice the server
330 // makes.
331 optional bytes ordinal_in_parent = 24;
293 }; 332 };
294 333
295 // This message contains diagnostic information used to correlate 334 // This message contains diagnostic information used to correlate
296 // commit-related traffic with extensions-related mutations to the 335 // commit-related traffic with extensions-related mutations to the
297 // data models in chromium. It plays no functional role in 336 // data models in chromium. It plays no functional role in
298 // processing this CommitMessage. 337 // processing this CommitMessage.
299 message ChromiumExtensionsActivity { 338 message ChromiumExtensionsActivity {
300 // The human-readable ID identifying the extension responsible 339 // The human-readable ID identifying the extension responsible
301 // for the traffic reported in this ChromiumExtensionsActivity. 340 // for the traffic reported in this ChromiumExtensionsActivity.
302 optional string extension_id = 1; 341 optional string extension_id = 1;
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 // response is returned to the client indicating that the server has received 492 // response is returned to the client indicating that the server has received
454 // the request and has begun to clear data. 493 // the request and has begun to clear data.
455 message ClearUserDataMessage { 494 message ClearUserDataMessage {
456 } 495 }
457 496
458 message ClearUserDataResponse { 497 message ClearUserDataResponse {
459 } 498 }
460 499
461 message ClientToServerMessage { 500 message ClientToServerMessage {
462 required string share = 1; 501 required string share = 1;
463 optional int32 protocol_version = 2 [default = 30]; 502 optional int32 protocol_version = 2 [default = 31];
464 enum Contents { 503 enum Contents {
465 COMMIT = 1; 504 COMMIT = 1;
466 GET_UPDATES = 2; 505 GET_UPDATES = 2;
467 AUTHENTICATE = 3; 506 AUTHENTICATE = 3;
468 CLEAR_DATA = 4; 507 CLEAR_DATA = 4;
469 } 508 }
470 509
471 required Contents message_contents = 3; 510 required Contents message_contents = 3;
472 optional CommitMessage commit = 4; 511 optional CommitMessage commit = 4;
473 optional GetUpdatesMessage get_updates = 5; 512 optional GetUpdatesMessage get_updates = 5;
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 optional string store_birthday = 6; 712 optional string store_birthday = 6;
674 713
675 optional ClientCommand client_command = 7; 714 optional ClientCommand client_command = 7;
676 optional ProfilingData profiling_data = 8; 715 optional ProfilingData profiling_data = 8;
677 716
678 // The data types whose storage has been migrated. Present when the value of 717 // The data types whose storage has been migrated. Present when the value of
679 // error_code is MIGRATION_DONE. 718 // error_code is MIGRATION_DONE.
680 repeated int32 migrated_data_type_id = 12; 719 repeated int32 migrated_data_type_id = 12;
681 }; 720 };
682 721
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698