Identity Service: Queue requests until internal state is stable

Desktop / Chromium - Colin Blundell [] - 13 July 2017 06:17 EDT

Chromium's signin code currently allows querying signin state before all information has been loaded from disk at startup (e.g., before all refresh tokens have been loaded). This forces consumers to worry about the edge case of a refresh token not being available simply because it hasn't been loaded yet.

The Identity Service APIs can eliminate this edge case by guaranteeing that they do not respond to consumers until the internal state has stabilized after startup. This CL implements this functionaliy, having IdentityService queue pending IdentityManager connection requests until all refresh tokens have been loaded.

Note that this change requires that consumers of the Identity Service ensure that the PO2TS's tokens are loaded if connecting to the Identity Service in test contexts, as otherwise the connection to the Identity Service will hang. In production, it's guaranteed that the PO2TS will fire OnRefreshTokensLoaded() as part of startup (see the relevant CLs and,

Bug: 740117 Change-Id: Id5c9c1ef7e2975204b3c2c004b7b5a714f6499b9 Reviewed-on: Commit-Queue: Colin Blundell

6430f5d Identity Service: Queue requests until internal state is stable
chrome/browser/chromeos/login/ | 12 ++-
.../extensions/api/identity/ | 4 +
services/identity/ | 11 +++
services/identity/ | 103 +++++++++++++++++++++
services/identity/ | 30 +++++-
services/identity/identity_service.h | 22 ++++-
.../public/interfaces/identity_manager.mojom | 6 +-
7 files changed, 181 insertions(+), 7 deletions(-)


  • Share