Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1350)

Unified Diff: chrome/browser/invalidation/ticl_invalidation_service.cc

Issue 21140004: Refresh access tokens for TiclInvalidationService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update comment Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/invalidation/ticl_invalidation_service.cc
diff --git a/chrome/browser/invalidation/ticl_invalidation_service.cc b/chrome/browser/invalidation/ticl_invalidation_service.cc
index ee2da37e8c620d76aadbbbd59df21dad82b69026..5863be8dee177bb9d4f732efa73e0d47b387f63b 100644
--- a/chrome/browser/invalidation/ticl_invalidation_service.cc
+++ b/chrome/browser/invalidation/ticl_invalidation_service.cc
@@ -258,7 +258,15 @@ void TiclInvalidationService::OnGetTokenFailure(
void TiclInvalidationService::OnInvalidatorStateChange(
syncer::InvalidatorState state) {
- invalidator_registrar_->UpdateInvalidatorState(state);
+ if (state == syncer::INVALIDATION_CREDENTIALS_REJECTED) {
+ // This may be due to normal OAuth access token expiration. If so, we must
+ // fetch a new one using our refresh token. Resetting the invalidator's
+ // access token will not reset the invalidator's exponential backoff, so
+ // it's safe to try to update the token every time we receive this signal.
akalin 2013/07/31 22:37:46 Add comment saying that if the credentials continu
akalin 2013/07/31 22:42:45 per our discussion, transition to TRANSIENT_ERROR
rlarocque 2013/07/31 23:00:53 Done.
+ RequestAccessToken();
+ } else {
+ invalidator_registrar_->UpdateInvalidatorState(state);
+ }
}
void TiclInvalidationService::OnIncomingInvalidation(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698