AccessTokenFetcher: Add ability to wait for refresh token availability
Sync would like to use one AccessTokenFetcher instance to fetch access tokens both for the primary account and for secondary accounts. For the primary account, they would like to wait for the refresh token to be available. In order to support this use case, AccessTokenFetcher needs a Mode parameter. This CL adds that Mode parameter. Note that this Mode parameter is *not identical* semantically to the Mode parameter of PrimaryAccountAccessTokenFetcher: the former's |kWaitUntilAvailable| mode makes an access token request once there is an account that is both (a) primary and (b) has a refresh token available, while the latter's new |kWaitUntilRefreshTokenAvailable| mode simply waits until there is a refresh token available for the given account (which may no longer be primary at that point, even if it was at the time of creating the AccessTokenFetcher). This semantic distinction is called out explicitly in the comments on PrimaryAccountAccessTokenFetcher::Mode. Sync has indicated that the AccessTokenFetcher semantics suffice for their use case. Bug: 840703, 729547 Change-Id: Iff39a24ef74945b3e9fa22ad961c3cd73a401e51 Reviewed-on: https://chromium-review.googlesource.com/1158831 Commit-Queue: Marc Treib <treib@chromium.org> Reviewed-by:Mihai Sardarescu <msarda@chromium.org> Cr-Commit-Position: refs/heads/master@{#582535}
Showing
This diff is collapsed.
Please register or sign in to comment