• Marc Treib's avatar
    AccessTokenFetcher: Add ability to wait for refresh token availability · 46f3a042
    Marc Treib authored
    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: default avatarMihai Sardarescu <msarda@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#582535}
    46f3a042
account_tracker.cc 9.35 KB