Support uploading fcm_token with Sharing sender ID
- Add sharing_fcm_token to SharingSpecificFields and rename current
fcm_token field to vapid_fcm_token
- GetToken with both VAPID authorized_entity and sender ID
- Introduced SharingTargetInfo struct for sending messages
- Replaced GetSharingInfo in SharingSyncPreference with more efficient
methods to only read required information from preferences
Bug: 1018145
Change-Id: Iab01f3866124d13fea10d70bec4faa6150ce6377
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1904167
Reviewed-by: Michael van Ouwerkerk <[email protected]>
Reviewed-by: Mikel Astiz <[email protected]>
Commit-Queue: Alex Chau <[email protected]>
Cr-Commit-Position: refs/heads/master@{#715256}
diff --git a/components/sync_device_info/device_info.h b/components/sync_device_info/device_info.h
index 644e2a7..d5342a0f 100644
--- a/components/sync_device_info/device_info.h
+++ b/components/sync_device_info/device_info.h
@@ -26,7 +26,8 @@
class DeviceInfo {
public:
struct SharingInfo {
- SharingInfo(std::string fcm_token,
+ SharingInfo(std::string vapid_fcm_token,
+ std::string sharing_fcm_token,
std::string p256dh,
std::string auth_secret,
std::set<sync_pb::SharingSpecificFields::EnabledFeatures>
@@ -36,8 +37,11 @@
SharingInfo& operator=(const SharingInfo& other);
~SharingInfo();
- // FCM registration token of device for sending Sharing messages.
- std::string fcm_token;
+ // FCM registration token of device subscribed using VAPID key.
+ std::string vapid_fcm_token;
+
+ // FCM registration token of device subscribed using Sharing sender ID.
+ std::string sharing_fcm_token;
// Subscription public key required for Sharing message encryption[RFC8291].
std::string p256dh;