OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 // response is returned to the client indicating that the server has received | 413 // response is returned to the client indicating that the server has received |
414 // the request and has begun to clear data. | 414 // the request and has begun to clear data. |
415 message ClearUserDataMessage { | 415 message ClearUserDataMessage { |
416 } | 416 } |
417 | 417 |
418 message ClearUserDataResponse { | 418 message ClearUserDataResponse { |
419 } | 419 } |
420 | 420 |
421 message ClientToServerMessage { | 421 message ClientToServerMessage { |
422 required string share = 1; | 422 required string share = 1; |
423 optional int32 protocol_version = 2 [default = 29]; | 423 optional int32 protocol_version = 2 [default = 30]; |
424 enum Contents { | 424 enum Contents { |
425 COMMIT = 1; | 425 COMMIT = 1; |
426 GET_UPDATES = 2; | 426 GET_UPDATES = 2; |
427 AUTHENTICATE = 3; | 427 AUTHENTICATE = 3; |
428 CLEAR_DATA = 4; | 428 CLEAR_DATA = 4; |
429 } | 429 } |
430 | 430 |
431 required Contents message_contents = 3; | 431 required Contents message_contents = 3; |
432 optional CommitMessage commit = 4; | 432 optional CommitMessage commit = 4; |
433 optional GetUpdatesMessage get_updates = 5; | 433 optional GetUpdatesMessage get_updates = 5; |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
620 // Google Account. | 620 // Google Account. |
621 AUTH_INVALID = 6; // Auth token or cookie is otherwise invalid. | 621 AUTH_INVALID = 6; // Auth token or cookie is otherwise invalid. |
622 CLEAR_PENDING = 7; // A clear of the user data is pending (e.g. | 622 CLEAR_PENDING = 7; // A clear of the user data is pending (e.g. |
623 // initiated by privacy request). Client should | 623 // initiated by privacy request). Client should |
624 // come back later. | 624 // come back later. |
625 TRANSIENT_ERROR = 8; // A transient error occured (eg. backend | 625 TRANSIENT_ERROR = 8; // A transient error occured (eg. backend |
626 // timeout). Client should try again later. | 626 // timeout). Client should try again later. |
627 MIGRATION_DONE = 9; // Migration has finished for one or more data | 627 MIGRATION_DONE = 9; // Migration has finished for one or more data |
628 // types. Client should clear the cache for | 628 // types. Client should clear the cache for |
629 // these data types only and then re-sync with | 629 // these data types only and then re-sync with |
630 // a server. | 630 // a server. The migrated datatypes are in the |
| 631 // |migrated_datatype_ids| field. |
631 UNKNOWN = 100; // Unknown value. This should never be explicitly | 632 UNKNOWN = 100; // Unknown value. This should never be explicitly |
632 // used; it is the default value when an | 633 // used; it is the default value when an |
633 // out-of-date client parses a value it doesn't | 634 // out-of-date client parses a value it doesn't |
634 // recognize. | 635 // recognize. |
635 } | 636 } |
636 | 637 |
637 message Error { | 638 message Error { |
638 optional ErrorType error_type = 1 [default = UNKNOWN]; | 639 optional ErrorType error_type = 1 [default = UNKNOWN]; |
639 optional string error_description = 2; | 640 optional string error_description = 2; |
640 optional string url = 3; | 641 optional string url = 3; |
641 enum Action { | 642 enum Action { |
642 UPGRADE_CLIENT = 0; // Upgrade the client to latest version. | 643 UPGRADE_CLIENT = 0; // Upgrade the client to latest version. |
643 CLEAR_USER_DATA_AND_RESYNC = 1; // Clear user data from dashboard and | 644 CLEAR_USER_DATA_AND_RESYNC = 1; // Clear user data from dashboard and |
644 // setup sync again. | 645 // setup sync again. |
645 ENABLE_SYNC_ON_ACCOUNT = 2; // The administrator needs to enable sync | 646 ENABLE_SYNC_ON_ACCOUNT = 2; // The administrator needs to enable sync |
646 // on the account. | 647 // on the account. |
647 STOP_AND_RESTART_SYNC = 3; // Stop sync and set up sync again. | 648 STOP_AND_RESTART_SYNC = 3; // Stop sync and set up sync again. |
648 DISABLE_SYNC_ON_CLIENT = 4; // Wipe the client of all sync data and | 649 DISABLE_SYNC_ON_CLIENT = 4; // Wipe the client of all sync data and |
649 // stop syncing. | 650 // stop syncing. |
650 UNKNOWN_ACTION = 5; // This is the default. | 651 UNKNOWN_ACTION = 5; // This is the default. |
651 } | 652 } |
652 optional Action action = 4 [default = UNKNOWN_ACTION]; | 653 optional Action action = 4 [default = UNKNOWN_ACTION]; |
| 654 |
| 655 // Currently only meaningful if |error_type| is throttled. If this field |
| 656 // is absent then the whole client (all datatypes) is throttled. |
| 657 repeated int32 error_data_type_ids = 5; |
653 } | 658 } |
654 | 659 |
655 optional Error error = 13; | 660 optional Error error = 13; |
656 | 661 |
657 // Up until protocol_version 24, the default was SUCCESS which made it | 662 // Up until protocol_version 24, the default was SUCCESS which made it |
658 // impossible to add new enum values since older clients would parse any | 663 // impossible to add new enum values since older clients would parse any |
659 // out-of-range value as SUCCESS. Starting with 25, unless explicitly set, | 664 // out-of-range value as SUCCESS. Starting with 25, unless explicitly set, |
660 // the error_code will be UNKNOWN so that clients know when they're | 665 // the error_code will be UNKNOWN so that clients know when they're |
661 // out-of-date. Note also that when using protocol_version < 25, | 666 // out-of-date. Note also that when using protocol_version < 25, |
662 // TRANSIENT_ERROR is not supported. Instead, the server sends back a HTTP | 667 // TRANSIENT_ERROR is not supported. Instead, the server sends back a HTTP |
663 // 400 error code. This is deprecated now. | 668 // 400 error code. This is deprecated now. |
664 optional ErrorType error_code = 4 [default = UNKNOWN]; | 669 optional ErrorType error_code = 4 [default = UNKNOWN]; |
665 optional string error_message = 5; | 670 optional string error_message = 5; |
666 | 671 |
667 // Opaque store ID; if it changes, the contents of the client's cache | 672 // Opaque store ID; if it changes, the contents of the client's cache |
668 // is meaningless to this server. This happens most typically when | 673 // is meaningless to this server. This happens most typically when |
669 // you switch from one storage backend instance (say, a test instance) | 674 // you switch from one storage backend instance (say, a test instance) |
670 // to another (say, the official instance). | 675 // to another (say, the official instance). |
671 optional string store_birthday = 6; | 676 optional string store_birthday = 6; |
672 | 677 |
673 optional ClientCommand client_command = 7; | 678 optional ClientCommand client_command = 7; |
674 optional ProfilingData profiling_data = 8; | 679 optional ProfilingData profiling_data = 8; |
675 | 680 |
676 // The data types whose storage has been migrated. Present when the value of | 681 // The data types whose storage has been migrated. Present when the value of |
677 // error_code is MIGRATION_DONE. | 682 // error_code is MIGRATION_DONE. |
678 repeated int32 migrated_data_type_id = 12; | 683 repeated int32 migrated_data_type_id = 12; |
679 }; | 684 }; |
680 | 685 |
OLD | NEW |