Commit d646232e authored by Mihai Sardarescu's avatar Mihai Sardarescu Committed by Commit Bot

[Dice] TiclInvalidationService should start when the user signs in.

If the token service has already a refresh token for the authenticated
account before this account is signed in to Chrome, then |OnRefreshTokenAvailable|
notification will not be called after |OnActiveAccountLogin|.

This CL changes the TiclInvalidationService to handle the case when the
refresh token is already present when |OnActiveAccountLogin| is fired.

See bug for the link to the design document.

Bug: 733226
Change-Id: I205e522ebe75c059b9125e113f451cf328a2f564
Reviewed-on: https://chromium-review.googlesource.com/559537Reviewed-by: default avatarPavel Yatsuk <pavely@chromium.org>
Commit-Queue: Mihai Sardarescu <msarda@chromium.org>
Cr-Commit-Position: refs/heads/master@{#487594}
parent 84eef4fa
......@@ -253,6 +253,11 @@ void TiclInvalidationService::OnGetTokenFailure(
}
}
void TiclInvalidationService::OnActiveAccountLogin() {
if (!IsStarted() && IsReadyToStart())
StartInvalidator(network_channel_type_);
}
void TiclInvalidationService::OnRefreshTokenAvailable(
const std::string& account_id) {
if (!IsStarted() && IsReadyToStart())
......
......@@ -98,6 +98,7 @@ class TiclInvalidationService : public InvalidationService,
void OnRefreshTokenRevoked(const std::string& account_id) override;
// IdentityProvider::Observer implementation.
void OnActiveAccountLogin() override;
void OnActiveAccountLogout() override;
// TiclSettingsProvider::Observer implementation.
......
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