• Colin Blundell's avatar
    Change SyncAuthManager to explicitly check error state of refresh token · 32a34bff
    Colin Blundell authored
    When SyncAuthManager receives an OnRefreshTokenUpdatedForAccount()
    observer callback from IdentityManager, it queries the value of the
    |is_valid| parameter. However, we are going to be removing that
    parameter altogether as it is confusing for the common case where
    consumers *shouldn't* check it.
    
    This CL changes SyncAuthManager to compute the validity internally by
    querying the error state of the refresh token via IdentityManager.
    There should be no functional change.
    
    The logic of the computation of whether the refresh token is valid is
    taken from the internal computation of the |is_valid| parameter that
    IdentityManager does. As a followup, we can consider re-hiding that
    logic inside IdentityManager via a helper method to reduce fragility.
    
    Bug: 908412
    Change-Id: I4842652dc63bea7169e4e915b5f4382e9291a0ea
    Reviewed-on: https://chromium-review.googlesource.com/c/1350888
    Commit-Queue: Marc Treib <treib@chromium.org>
    Commit-Queue: Colin Blundell <blundell@chromium.org>
    Reviewed-by: default avatarMarc Treib <treib@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#612120}
    32a34bff
sync_auth_manager.cc 18.4 KB