• Sylvain Defresne's avatar
    Simplify AuthenticationService implementation · 4671054f
    Sylvain Defresne authored
    Change internal implementation of two methods of AuthenticationService
    to remove unnecessary allocations.
    
    1.  AuthenticationService::MigrateAccountsStoredInPrefsIfNeeded is
        only interested in whether the system has stored refresh token
        for an account by account_id, so use HasAccountWithRefreshToken
        instead of fetching the whole AccountInfo
    
    2.  AuthenticationService::ReloadCredentialsFromIdentities only need
        to check whether the system has a primary account set, and is not
        interested in the email address, so use IsAuthenticated instead
        of GetAuthenticatedUserEmail
    
    Bug: none
    Change-Id: If5de15711ef2d2d96dc935162b11aa17c4b245fe
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1569122
    Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
    Reviewed-by: default avatarMihai Sardarescu <msarda@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#652542}
    4671054f
authentication_service.mm 21.7 KB