Commit 97e2a4c8 authored by Rushan Suleymanov's avatar Rushan Suleymanov Committed by Chromium LUCI CQ

[Sync] Set the instance ID token TTL for the new invalidations

Bug: 1108780
Change-Id: I11765de4e2c29f8a0cc464f0af283aff36b702b9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2570566
Commit-Queue: Rushan Suleymanov <rushans@google.com>
Reviewed-by: default avatarMarc Treib <treib@chromium.org>
Cr-Commit-Position: refs/heads/master@{#833330}
parent 2da9399b
......@@ -21,6 +21,8 @@ namespace syncer {
// Lower bound time between two token validations when listening.
const int kTokenValidationPeriodMinutesDefault = 60 * 24;
const int kInstanceIDTokenTTLSeconds = 14 * 24 * 60 * 60; // 2 weeks.
FCMHandler::FCMHandler(gcm::GCMDriver* gcm_driver,
instance_id::InstanceIDDriver* instance_id_driver,
const std::string& sender_id,
......@@ -199,10 +201,9 @@ void FCMHandler::DidReceiveTokenForValidation(
void FCMHandler::StartTokenFetch(
instance_id::InstanceID::GetTokenCallback callback) {
// TODO(crbug.com/1108780): set appropriate TTL.
instance_id_driver_->GetInstanceID(app_id_)->GetToken(
sender_id_, instance_id::kGCMScope,
/*time_to_live=*/base::TimeDelta(),
/*time_to_live=*/base::TimeDelta::FromSeconds(kInstanceIDTokenTTLSeconds),
/*options=*/std::map<std::string, std::string>(),
/*flags=*/{instance_id::InstanceID::Flags::kIsLazy}, std::move(callback));
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment