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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
173 // Supplies a numeric position for this item, relative to other items with | 173 // Supplies a numeric position for this item, relative to other items with |
174 // the same parent. | 174 // the same parent. |
175 // | 175 // |
176 // Present in both GetUpdatesResponse and CommitMessage. | 176 // Present in both GetUpdatesResponse and CommitMessage. |
177 // | 177 // |
178 // In a CommitMessage context, server implementations may choose whether | 178 // In a CommitMessage context, server implementations may choose whether |
179 // to compute a position based on this field or based on | 179 // to compute a position based on this field or based on |
180 // |insert_after_item_id|. Clients should set both values so that they | 180 // |insert_after_item_id|. Clients should set both values so that they |
181 // result in a consistent ordering regardless of which choice the server | 181 // result in a consistent ordering regardless of which choice the server |
182 // makes. | 182 // makes. |
183 // | |
184 // This is deprecated: clients should set |ordinal_in_parent| | |
185 // instead. In the interim, clients should supply both | |
ncarter (slow)
2012/02/09 01:30:58
nit: The phrase "In the interim" made sense when t
| |
186 // |ordinal_in_parent| and |position_in_parent| and continue to honor the | |
187 // |ordinal_in_parent| value returned in the CommitResponse. | |
ncarter (slow)
2012/02/09 01:30:58
There is no ordinal_in_parent value returned in th
| |
188 // | |
189 // When both |ordinal_in_parent| and |position_in_parent| are set, | |
190 // the first 8 bytes of |ordinal_in_parent| should be equal to | |
191 // the bytes of flip-sign-bit(|position_in_parent|) in big-endian order | |
192 // (MSB first). | |
183 optional int64 position_in_parent = 15; | 193 optional int64 position_in_parent = 15; |
ncarter (slow)
2012/02/09 01:30:58
A draft of some possible language about the deprec
| |
184 | 194 |
185 // Contains the ID of the element (under the same parent) after which this | 195 // Contains the ID of the element (under the same parent) after which this |
186 // element resides. An empty string indicates that the element is the first | 196 // element resides. An empty string indicates that the element is the first |
187 // element in the parent. This value is used during commits to specify | 197 // element in the parent. This value is used during commits to specify |
188 // a relative position for a position change. In the context of | 198 // a relative position for a position change. In the context of |
189 // a GetUpdatesMessage, |position_in_parent| is used instead to | 199 // a GetUpdatesMessage, |position_in_parent| is used instead to |
190 // communicate position. | 200 // communicate position. |
191 // | 201 // |
192 // Present only in CommitMessage. | 202 // Present only in CommitMessage. |
193 // | 203 // |
194 // This is being deprecated: clients should now explicitly set | 204 // This is being deprecated: clients should now explicitly set |
195 // an absolute |position_in_parent| value at commit time. In the | 205 // an absolute |position_in_parent| value at commit time. In the |
ncarter (slow)
2012/02/09 01:30:58
This comment (which redirects to another deprecate
| |
196 // interim, clients should supply both values and continue to honor | 206 // interim, clients should supply both values and continue to honor |
197 // the |position_in_parent| value returned in the CommitResponse. | 207 // the |position_in_parent| value returned in the CommitResponse. |
198 optional string insert_after_item_id = 16; | 208 optional string insert_after_item_id = 16; |
199 | 209 |
200 // Arbitrary key/value pairs associated with this item. | 210 // Arbitrary key/value pairs associated with this item. |
201 // Present in both GetUpdatesResponse and CommitMessage. | 211 // Present in both GetUpdatesResponse and CommitMessage. |
202 // Deprecated. | 212 // Deprecated. |
203 // optional ExtendedAttributes extended_attributes = 17; | 213 // optional ExtendedAttributes extended_attributes = 17; |
204 | 214 |
205 // If true, indicates that this item has been (or should be) deleted. | 215 // If true, indicates that this item has been (or should be) deleted. |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
248 // c) Client tag - If client committed the item as unique | 258 // c) Client tag - If client committed the item as unique |
249 // | 259 // |
250 // May be present in CommitMessages for the initial creation of an entity. | 260 // May be present in CommitMessages for the initial creation of an entity. |
251 // If present in Commit updates for the entity, it will be ignored. | 261 // If present in Commit updates for the entity, it will be ignored. |
252 // | 262 // |
253 // Available in version 24+. | 263 // Available in version 24+. |
254 // | 264 // |
255 // May be returned in GetUpdatesMessage and sent up in CommitMessage. | 265 // May be returned in GetUpdatesMessage and sent up in CommitMessage. |
256 // | 266 // |
257 optional string client_defined_unique_tag = 23; | 267 optional string client_defined_unique_tag = 23; |
268 | |
269 // Supplies an ordinal for this item, relative to other items with the | |
270 // same parent. Ordinals are ordered lexicographically bytewise. | |
271 // Ordinals must be a least 8 bytes (for backwards compatibility), and | |
272 // must not be all zeroes. | |
273 // | |
274 // Available in version 31+. | |
275 // | |
276 // Present in both GetUpdatesResponse and CommitMessage. | |
277 // | |
278 // In a CommitMessage context, server implementations may choose whether | |
279 // to compute a position based on this field, |position_in_parent|, or | |
280 // |insert_after_item_id|. Clients should set all values so that they | |
281 // result in a consistent ordering regardless of which choice the server | |
282 // makes. | |
283 optional bytes ordinal_in_parent = 24; | |
258 }; | 284 }; |
259 | 285 |
260 // This message contains diagnostic information used to correlate | 286 // This message contains diagnostic information used to correlate |
261 // commit-related traffic with extensions-related mutations to the | 287 // commit-related traffic with extensions-related mutations to the |
262 // data models in chromium. It plays no functional role in | 288 // data models in chromium. It plays no functional role in |
263 // processing this CommitMessage. | 289 // processing this CommitMessage. |
264 message ChromiumExtensionsActivity { | 290 message ChromiumExtensionsActivity { |
265 // The human-readable ID identifying the extension responsible | 291 // The human-readable ID identifying the extension responsible |
266 // for the traffic reported in this ChromiumExtensionsActivity. | 292 // for the traffic reported in this ChromiumExtensionsActivity. |
267 optional string extension_id = 1; | 293 optional string extension_id = 1; |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
417 // response is returned to the client indicating that the server has received | 443 // response is returned to the client indicating that the server has received |
418 // the request and has begun to clear data. | 444 // the request and has begun to clear data. |
419 message ClearUserDataMessage { | 445 message ClearUserDataMessage { |
420 } | 446 } |
421 | 447 |
422 message ClearUserDataResponse { | 448 message ClearUserDataResponse { |
423 } | 449 } |
424 | 450 |
425 message ClientToServerMessage { | 451 message ClientToServerMessage { |
426 required string share = 1; | 452 required string share = 1; |
427 optional int32 protocol_version = 2 [default = 30]; | 453 optional int32 protocol_version = 2 [default = 31]; |
428 enum Contents { | 454 enum Contents { |
429 COMMIT = 1; | 455 COMMIT = 1; |
430 GET_UPDATES = 2; | 456 GET_UPDATES = 2; |
431 AUTHENTICATE = 3; | 457 AUTHENTICATE = 3; |
432 CLEAR_DATA = 4; | 458 CLEAR_DATA = 4; |
433 } | 459 } |
434 | 460 |
435 required Contents message_contents = 3; | 461 required Contents message_contents = 3; |
436 optional CommitMessage commit = 4; | 462 optional CommitMessage commit = 4; |
437 optional GetUpdatesMessage get_updates = 5; | 463 optional GetUpdatesMessage get_updates = 5; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
485 | 511 |
486 // This name is the same as the non_unique_name field returned within the | 512 // This name is the same as the non_unique_name field returned within the |
487 // SyncEntity message in GetUpdatesResponse. | 513 // SyncEntity message in GetUpdatesResponse. |
488 optional string non_unique_name = 8; | 514 optional string non_unique_name = 8; |
489 | 515 |
490 optional string error_message = 9; | 516 optional string error_message = 9; |
491 | 517 |
492 // Last modification time (in java time milliseconds). Allows the server | 518 // Last modification time (in java time milliseconds). Allows the server |
493 // to override the client-supplied mtime during a commit operation. | 519 // to override the client-supplied mtime during a commit operation. |
494 optional int64 mtime = 10; | 520 optional int64 mtime = 10; |
521 | |
522 // This value is the same as the ordinal_in_parent value returned within | |
523 // the SyncEntity message in GetUpdatesResponse. | |
524 optional bytes ordinal_in_parent = 11; | |
495 } | 525 } |
496 }; | 526 }; |
497 | 527 |
498 message GetUpdatesResponse { | 528 message GetUpdatesResponse { |
499 // New sync entries that the client should apply. | 529 // New sync entries that the client should apply. |
500 repeated SyncEntity entries = 1; | 530 repeated SyncEntity entries = 1; |
501 | 531 |
502 // If there are more changes on the server that weren't processed during this | 532 // If there are more changes on the server that weren't processed during this |
503 // GetUpdates request, the client should send another GetUpdates request and | 533 // GetUpdates request, the client should send another GetUpdates request and |
504 // use new_timestamp as the from_timestamp value within GetUpdatesMessage. | 534 // use new_timestamp as the from_timestamp value within GetUpdatesMessage. |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
637 optional string store_birthday = 6; | 667 optional string store_birthday = 6; |
638 | 668 |
639 optional ClientCommand client_command = 7; | 669 optional ClientCommand client_command = 7; |
640 optional ProfilingData profiling_data = 8; | 670 optional ProfilingData profiling_data = 8; |
641 | 671 |
642 // The data types whose storage has been migrated. Present when the value of | 672 // The data types whose storage has been migrated. Present when the value of |
643 // error_code is MIGRATION_DONE. | 673 // error_code is MIGRATION_DONE. |
644 repeated int32 migrated_data_type_id = 12; | 674 repeated int32 migrated_data_type_id = 12; |
645 }; | 675 }; |
646 | 676 |
OLD | NEW |