This CL enables the AccountReconcilor when Dice is fully enabled: see AccountReconcilor::IsAccountConsistencyEnabled().
To prevent conflicts between Dice and the account reconcilor, a new mechanism to block (suspend) the reconcilor is introduced: AccountReconcilor::Lock. The reconcilor is blocked as long as one instance of this class is alive.
The blocking starts when the Dice request header is sent, and ends when the new token has been added to the token service. This is implemented by using three instances of AccountReconcilor::Lock.- attached to the the net::URLRequest that carries signin cookies,- attached to the net::Request that carries Dice headers,
- attached to the DiceTokenFetcher.
The lifetimes of these locks overlap, and so the account reconcilor is blocked and unblocked only once.
Tests have been added to ensure that the AccountReconcilor is correctly blocked and unblocked.
Bug: 761362 Change-Id: I5564364516540554dfb4741fd9d3998d84507b9d Reviewed-on: https://chromium-review.googlesource.com/647749 Commit-Queue: David Roger
59ed01b [signin] Enable the AccountReconcilor with Dice.
.../browser/signin/account_reconcilor_unittest.cc | 75 ++++++++++-
chrome/browser/signin/chrome_signin_helper.cc | 144 ++++++++++++++++++++-
chrome/browser/signin/chrome_signin_helper.h | 4 +
chrome/browser/signin/dice_browsertest.cc | 102 +++++++++++++--
chrome/browser/signin/dice_response_handler.cc | 20 ++-
chrome/browser/signin/dice_response_handler.h | 9 +-
.../signin/dice_response_handler_unittest.cc | 46 ++++++-
.../signin/core/browser/account_reconcilor.cc | 83 +++++++++++-
.../signin/core/browser/account_reconcilor.h | 73 ++++++++++-
.../signin/core/browser/signin_header_helper.cc | 37 ++++--
.../signin/core/browser/signin_header_helper.h | 21 ++-
.../core/browser/signin_header_helper_unittest.cc | 27 ++--
12 files changed, 577 insertions(+), 64 deletions(-)