OLD | NEW |
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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 // the same parent. | 216 // the same parent. |
217 // | 217 // |
218 // Present in both GetUpdatesResponse and CommitMessage. | 218 // Present in both GetUpdatesResponse and CommitMessage. |
219 // | 219 // |
220 // In a CommitMessage context, server implementations may choose whether | 220 // In a CommitMessage context, server implementations may choose whether |
221 // to compute a position based on this field or based on | 221 // to compute a position based on this field or based on |
222 // |insert_after_item_id|. Clients should set both values so that they | 222 // |insert_after_item_id|. Clients should set both values so that they |
223 // result in a consistent ordering regardless of which choice the server | 223 // result in a consistent ordering regardless of which choice the server |
224 // makes. | 224 // makes. |
225 // | 225 // |
226 // This is deprecated: clients should set |ordinal_in_parent| | 226 // This is deprecated: clients should set |unique_position| |
227 // instead. But until the production servers fully support | 227 // instead. But until the production servers fully support |
228 // |ordinal_in_parent|, clients should set all three position fields | 228 // |unique_position|, clients should set all three position fields |
229 // (|position_in_parent|, |insert_after_item_id|, and | 229 // (|position_in_parent|, |insert_after_item_id|, and |
230 // |ordinal_in_parent| in commits) and continue to respect any | 230 // |unique_position| in commits) and continue to respect any |
231 // |position_in_parent| values returned by CommitResponses. | 231 // |position_in_parent| values returned by CommitResponses. |
232 // | 232 // |
233 // Similarly, when |ordinal_in_parent| is absent in a GetUpdates and | 233 // Similarly, when |unique_position| is absent in a GetUpdates and |
234 // |position_in_parent| is present, clients should continue to honor | 234 // |position_in_parent| is present, clients should continue to honor |
235 // the |position_in_parent| value (after transforming it as | 235 // the |position_in_parent| value (after transforming it as |
236 // described below). | 236 // described below). |
237 // | 237 // |
238 // When both |ordinal_in_parent| and |position_in_parent| are set, | 238 // When both |unique_position| and |position_in_parent| are set, the first 8 |
239 // the first 8 bytes of |ordinal_in_parent| must be equal to the | 239 // bytes of |unique_position| must be equal to the bytes of |
240 // bytes of flip-sign-bit(|position_in_parent|) in big-endian order | 240 // flip-sign-bit(|position_in_parent|) in big-endian order (MSB first). The |
241 // (MSB first), and if those bytes are all zero, a 9th byte equal to | 241 // |unique_position| verstion will also include trailing bytes that may |
242 // 128 must be added. | 242 // provide more precise position information, a suffix, and a "terminator" |
| 243 // byte (0xFF). |
243 optional int64 position_in_parent = 15; | 244 optional int64 position_in_parent = 15; |
244 | 245 |
245 // Contains the ID of the element (under the same parent) after which this | 246 // Contains the ID of the element (under the same parent) after which this |
246 // element resides. An empty string indicates that the element is the first | 247 // element resides. An empty string indicates that the element is the first |
247 // element in the parent. This value is used during commits to specify | 248 // element in the parent. This value is used during commits to specify |
248 // a relative position for a position change. In the context of | 249 // a relative position for a position change. In the context of |
249 // a GetUpdatesMessage, |position_in_parent| is used instead to | 250 // a GetUpdatesMessage, |position_in_parent| is used instead to |
250 // communicate position. | 251 // communicate position. |
251 // | 252 // |
252 // Present only in CommitMessage. | 253 // Present only in CommitMessage. |
253 // This is deprecated: see comment for |position_in_parent| above. | 254 // This is deprecated: see comment for |position_in_parent| above. |
254 optional string insert_after_item_id = 16; | 255 optional string insert_after_item_id = 16; |
255 | 256 |
256 // Arbitrary key/value pairs associated with this item. | 257 // Arbitrary key/value pairs associated with this item. |
257 // Present in both GetUpdatesResponse and CommitMessage. | 258 // Present in both GetUpdatesResponse and CommitMessage. |
258 // Deprecated. | 259 // Deprecated. |
259 // optional ExtendedAttributes extended_attributes = 17; | 260 // optional ExtendedAttributes extended_attributes = 17; |
260 | 261 |
261 // If true, indicates that this item has been (or should be) deleted. | 262 // If true, indicates that this item has been (or should be) deleted. |
262 // Present in both GetUpdatesResponse and CommitMessage. | 263 // Present in both GetUpdatesResponse and CommitMessage. |
263 optional bool deleted = 18 [default = false]; | 264 optional bool deleted = 18 [default = false]; |
264 | 265 |
265 // A GUID that identifies the the sync client who initially committed | 266 // A GUID that identifies the the sync client who initially committed |
266 // this entity. This value corresponds to |cache_guid| in CommitMessage. | 267 // this entity. This value corresponds to |cache_guid| in CommitMessage. |
267 // This field, along with |originator_client_item_id|, can be used to | 268 // This field, along with |originator_client_item_id|, can be used to |
268 // reunite the original with its official committed version in the case | 269 // reunite the original with its official committed version in the case |
269 // where a client does not receive or process the commit response for | 270 // where a client does not receive or process the commit response for |
270 // some reason. | 271 // some reason. |
| 272 // |
271 // Present only in GetUpdatesResponse. | 273 // Present only in GetUpdatesResponse. |
| 274 // |
| 275 // This field is also used in determinging the unique identifier used in |
| 276 // bookmarks' unique_position field. It is expected that the string consist |
| 277 // of 16 bytes of data that have been base64 encoded. |
272 optional string originator_cache_guid = 19; | 278 optional string originator_cache_guid = 19; |
273 | 279 |
274 // The local item id of this entry from the client that initially | 280 // The local item id of this entry from the client that initially |
275 // committed this entity. Typically a negative integer. | 281 // committed this entity. Typically a negative integer. |
276 // Present only in GetUpdatesResponse. | 282 // Present only in GetUpdatesResponse. |
| 283 // |
| 284 // This field is also used in determinging the unique identifier used in |
| 285 // bookmarks' unique_position field. It is expected that the ID be the string |
| 286 // representation of a negative 64bit integer. |
277 optional string originator_client_item_id = 20; | 287 optional string originator_client_item_id = 20; |
278 | 288 |
279 // Extensible container for datatype-specific data. | 289 // Extensible container for datatype-specific data. |
280 // This became available in version 23 of the protocol. | 290 // This became available in version 23 of the protocol. |
281 optional EntitySpecifics specifics = 21; | 291 optional EntitySpecifics specifics = 21; |
282 | 292 |
283 // Indicate whether this is a folder or not. Available in version 23+. | 293 // Indicate whether this is a folder or not. Available in version 23+. |
284 optional bool folder = 22 [default = false]; | 294 optional bool folder = 22 [default = false]; |
285 | 295 |
286 // A client defined unique hash for this entity. | 296 // A client defined unique hash for this entity. |
(...skipping 18 matching lines...) Expand all Loading... |
305 // | 315 // |
306 // May be present in CommitMessages for the initial creation of an entity. | 316 // May be present in CommitMessages for the initial creation of an entity. |
307 // If present in Commit updates for the entity, it will be ignored. | 317 // If present in Commit updates for the entity, it will be ignored. |
308 // | 318 // |
309 // Available in version 24+. | 319 // Available in version 24+. |
310 // | 320 // |
311 // May be returned in GetUpdatesMessage and sent up in CommitMessage. | 321 // May be returned in GetUpdatesMessage and sent up in CommitMessage. |
312 // | 322 // |
313 optional string client_defined_unique_tag = 23; | 323 optional string client_defined_unique_tag = 23; |
314 | 324 |
315 // Supplies an ordinal for this item, relative to other items with the | 325 // This positioning system had a relatively short life. It was made obsolete |
316 // same parent. Ordinals are ordered lexicographically bytewise. | 326 // by |unique_position| before either the client or server made much of an |
317 // Ordinals must be at least 8 bytes (for backwards compatibility), and | 327 // attempt to support it. |
318 // must not be all zeroes. | 328 optional bytes ordinal_in_parent = 24; |
| 329 |
| 330 // This is the fourth attempt at positioning. |
319 // | 331 // |
320 // Clients should not make sure that each item they know of has a | 332 // Unique positions are unique per-item, since they are guaranteed to |
321 // unique ordinal-in-parent. However, updates from the server might | 333 // include a fixed-length suffix. The last byte of a unique position |
322 // break this invariant. In that case, among the items with the | 334 // is always 0xFF, which is appended to the unique suffix. |
323 // same ordinal-in-parent, a client should randomly pick one, and | |
324 // then perturb the ordinal-in-parents of all the other ones (within | |
325 // the bounds of the preceding and succeeding ordinal-in-parent) | |
326 // until they're unique; a byte of randomness per item should be | |
327 // more than enough. | |
328 // | 335 // |
329 // Available in version 31+. | 336 // Prior to both the suffix and terminator is the position information. This |
| 337 // sequence of bytes with arbitrary length are chosen such that this item |
| 338 // compares to its siblings as desired. |
330 // | 339 // |
331 // Present in both GetUpdatesResponse and CommitMessage. | 340 // Present in both GetUpdatesResponse and CommitMessage, if the client client |
| 341 // that wrote the item supports it. Older clients will not set this field, so |
| 342 // the receiver will need to convert the |server_position_in_parent| value |
| 343 // which will be present to a unique_position. |
332 // | 344 // |
333 // In a CommitMessage context, server implementations may choose whether | 345 // This field will not be set for items whose type ignores positioning. |
334 // to compute a position based on this field, |position_in_parent|, or | 346 // Clients will not attempt to read this field on the receipt of an item of a |
335 // |insert_after_item_id|. Clients should set all values so that they | 347 // type that ignores positioning. |
336 // result in a consistent ordering regardless of which choice the server | 348 optional bytes unique_position = 25; |
337 // makes. | |
338 optional bytes ordinal_in_parent = 24; | |
339 }; | 349 }; |
340 | 350 |
341 // This message contains diagnostic information used to correlate | 351 // This message contains diagnostic information used to correlate |
342 // commit-related traffic with extensions-related mutations to the | 352 // commit-related traffic with extensions-related mutations to the |
343 // data models in chromium. It plays no functional role in | 353 // data models in chromium. It plays no functional role in |
344 // processing this CommitMessage. | 354 // processing this CommitMessage. |
345 message ChromiumExtensionsActivity { | 355 message ChromiumExtensionsActivity { |
346 // The human-readable ID identifying the extension responsible | 356 // The human-readable ID identifying the extension responsible |
347 // for the traffic reported in this ChromiumExtensionsActivity. | 357 // for the traffic reported in this ChromiumExtensionsActivity. |
348 optional string extension_id = 1; | 358 optional string extension_id = 1; |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
726 // is absent then the whole client (all datatypes) is throttled. | 736 // is absent then the whole client (all datatypes) is throttled. |
727 repeated int32 error_data_type_ids = 5; | 737 repeated int32 error_data_type_ids = 5; |
728 } | 738 } |
729 optional Error error = 13; | 739 optional Error error = 13; |
730 | 740 |
731 // The new per-client state for this client. If set, should be persisted and | 741 // The new per-client state for this client. If set, should be persisted and |
732 // sent with any subsequent ClientToServerMessages. | 742 // sent with any subsequent ClientToServerMessages. |
733 optional ChipBag new_bag_of_chips = 14; | 743 optional ChipBag new_bag_of_chips = 14; |
734 }; | 744 }; |
735 | 745 |
OLD | NEW |