• Kushagra Sinha's avatar
    Refactoring: Move ownership of |ArcAuthContext| · ac040567
    Kushagra Sinha authored
    Move ownership of |ArcAuthContext| from |ArcSessionManager| to
    |ArcBackgroundAuthCodeFetcher|.
    
    ARC++ assumed that only one account will be synced between Chrome OS and
    ARC++, i.e. the Device Account. This assumption is no longer true
    because of the introduction of Chrome OS Account Manager (Design Doc is
    linked in the bug id).
    Syncing multiple accounts requires the ability to create multiple auth
    code fetchers which in turn require multiple |ArcAuthContext|s. This was
    not possible currently because of the ownership of a single
    |ArcAuthContext| by |ArcSessionManager|.
    
    |ArcSessionManager| does not really need an |ArcAuthContext|. It was
    needed only for:
    
      - Passing the context to |ArcBackgroundAuthCodeFetcher|: Not required
      if |ArcBackgroundAuthCodeFetcher| creates and owns the context.
      - Getting an instance of Token Service: Can be retrieved directly via
      |ProfileOAuth2TokenServiceFactory|.
      - |account_id| and |full_account_id|: Can be retrieved directly via
      |SigninManagerBase|.
    
    Bug: 871690
    Test: browser_tests --gtest_filter="*ArcAuthServiceTest*"
    Change-Id: I78a6d2aa6693529f67f480967258c9fb00469e02
    Reviewed-on: https://chromium-review.googlesource.com/1171237
    Commit-Queue: Kush Sinha <sinhak@chromium.org>
    Reviewed-by: default avatarHidehiko Abe <hidehiko@chromium.org>
    Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
    Reviewed-by: default avatarLutz Justen <ljusten@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#585456}
    ac040567
arc_session_manager.h 16.3 KB