Discussed AccountTrackerService offline with blundell, and the following invariant should always be true (except during startup when PO2TS and ATS state is being loaded from disk):
All accounts in AccountTrackerService should have a valid refresh token.
This is due to the following facts:
1. accounts are added in AccountTrackerService by calling SeedAccountInfo which is called after fetching the refresh token from gaia (this should always be true since the code requires a gaia id, which is obtained at the same time as refresh token)
2. accounts are removed from AccountTrackerService when accounts are removed from PO2TS (from AccountFetcherService::OnRefreshTokenRevoked)
3. after loading the refresh tokens, any account stored in AccountTrackerService for which PO2TS does not have valid refresh token is removed (see SigninManager::OnRefreshTokensLoaded).
Thus, we are going to assume that AccountTrackeRService only tracks accounts with valid refresh token (ideally it should be merged in PO2TS or at least should be owned by PO2TS).
Summary: ☂ Port consumers of AccountTrackerService and AccountFetcherService to use IdentityManager (was: ☂ Port consumers of AccountTrackerService to use IdentityManager)
Comment 1 by sdefresne@chromium.org
, Nov 27