sharing_message_specifics.proto 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. // Copyright 2020 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. //
  5. // Sync protocol datatype extension for sharing message.
  6. // If you change or add any fields in this file, update proto_visitors.h and
  7. // potentially proto_enum_conversions.{h, cc}.
  8. syntax = "proto2";
  9. option java_multiple_files = true;
  10. option java_package = "org.chromium.components.sync.protocol";
  11. option optimize_for = LITE_RUNTIME;
  12. package sync_pb;
  13. message SharingMessageSpecifics {
  14. // Unique identifier of message.
  15. optional string message_id = 1;
  16. message ChannelConfiguration {
  17. message FCMChannelConfiguration {
  18. // FCM registration token of target device.
  19. optional string token = 1;
  20. // Time to live for a FCM message (in seconds) - if specified, the message
  21. // will expire based on the TTL.
  22. optional int32 ttl = 2;
  23. // Priority level of a FCM message. 5 = normal, 10 = high.
  24. optional int32 priority = 3;
  25. }
  26. oneof channel_configuration {
  27. // FCM channel configuration. Message will be delivered as a FCM message.
  28. FCMChannelConfiguration fcm = 1;
  29. // Opaque server channel configuration. Message will be delivered through
  30. // server channel.
  31. bytes server = 2;
  32. }
  33. }
  34. optional ChannelConfiguration channel_configuration = 2;
  35. // Payload encrypted using the target user keys according to WebPush
  36. // encryption scheme. The payload has to be a valid
  37. // chrome/browser/sharing/proto/sharing_message.proto serialized using
  38. // SerializeToString.
  39. optional bytes payload = 3;
  40. }
  41. // Used for the server to return fine grained commit errors back to the client.
  42. message SharingMessageCommitError {
  43. // This enum is used in histograms. Entries should not be renumbered and
  44. // numeric values should never be reused. Also remember to update in
  45. // tools/metrics/histograms/enums.xml SyncSharingMessageCommitErrorCode enum.
  46. enum ErrorCode {
  47. NONE = 0;
  48. INVALID_ARGUMENT = 1;
  49. NOT_FOUND = 2;
  50. INTERNAL = 3;
  51. UNAVAILABLE = 4;
  52. RESOURCE_EXHAUSTED = 5;
  53. UNAUTHENTICATED = 6;
  54. PERMISSION_DENIED = 7;
  55. // Client-specific error codes.
  56. SYNC_TURNED_OFF = 8;
  57. SYNC_NETWORK_ERROR = 9;
  58. // Deprecated UMA bucket, prior to splitting between SYNC_SERVER_ERROR and
  59. // SYNC_AUTH_ERROR.
  60. DEPRECATED_SYNC_SERVER_OR_AUTH_ERROR = 10;
  61. // Message wasn't committed before timeout.
  62. SYNC_TIMEOUT = 11;
  63. // Error code for server error or unparsable server response.
  64. SYNC_SERVER_ERROR = 12;
  65. // Auth error when communicating with the server.
  66. SYNC_AUTH_ERROR = 13;
  67. }
  68. optional ErrorCode error_code = 1;
  69. }