Commit 6aff1d58 authored by Mohamed Amir Yosef's avatar Mohamed Amir Yosef Committed by Commit Bot

[FCM] Enable lazy mode for invalidations

Supporting lazy subscriptions modes for FCM subscription has been fully
implemented.

This CL enables the lazy mode for invalidations.

Bug: 882887
Change-Id: I47ab65b4895fed35dfdfd291ce155dc0928a14d5
Reviewed-on: https://chromium-review.googlesource.com/c/1347359Reviewed-by: default avatarTatiana Gornak <melandory@chromium.org>
Commit-Queue: Mohamed Amir Yosef <mamir@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610564}
parent 3ba3e2c0
......@@ -90,12 +90,10 @@ void FCMNetworkHandler::StartListening() {
// Being the listener is pre-requirement for token operations.
gcm_driver_->AddAppHandler(kInvalidationsAppId, this);
// TODO(https://crbug.com/882887): Switch to a lazy subscription when they are
// supported by the GCM driver.
instance_id_driver_->GetInstanceID(kInvalidationsAppId)
->GetToken(kInvalidationGCMSenderId, kGCMScope,
/*options=*/std::map<std::string, std::string>(),
/*is_lazy=*/false,
/*is_lazy=*/true,
base::BindRepeating(&FCMNetworkHandler::DidRetrieveToken,
weak_ptr_factory_.GetWeakPtr()));
}
......@@ -145,12 +143,10 @@ void FCMNetworkHandler::ScheduleNextTokenValidation() {
void FCMNetworkHandler::StartTokenValidation() {
DCHECK(IsListening());
// TODO(https://crbug.com/882887): Switch to a lazy subscription when they are
// supported by the GCM driver.
instance_id_driver_->GetInstanceID(kInvalidationsAppId)
->GetToken(kInvalidationGCMSenderId, kGCMScope,
std::map<std::string, std::string>(),
/*is_lazy=*/false,
/*is_lazy=*/true,
base::Bind(&FCMNetworkHandler::DidReceiveTokenForValidation,
weak_ptr_factory_.GetWeakPtr()));
}
......
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