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

Unified Diff: chrome/browser/sync/profile_sync_service.cc

Issue 472403002: Prevent invalidating refresh token on transient errors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix integration tests Created 6 years, 4 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 | chrome/browser/sync/test/integration/sync_auth_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/profile_sync_service.cc
diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc
index 955a4b6eb90c57232cd69c6f1f22a15fef2fbb48..07691854c374e3602534b4e182e54a0a10ec3e06 100644
--- a/chrome/browser/sync/profile_sync_service.cc
+++ b/chrome/browser/sync/profile_sync_service.cc
@@ -761,6 +761,8 @@ void ProfileSyncService::OnGetTokenFailure(
last_get_token_error_ = error;
switch (error.state()) {
case GoogleServiceAuthError::CONNECTION_FAILED:
+ case GoogleServiceAuthError::REQUEST_CANCELED:
+ case GoogleServiceAuthError::SERVICE_ERROR:
case GoogleServiceAuthError::SERVICE_UNAVAILABLE: {
// Transient error. Retry after some time.
request_access_token_backoff_.InformOfRequest(false);
@@ -774,7 +776,6 @@ void ProfileSyncService::OnGetTokenFailure(
NotifyObservers();
break;
}
- case GoogleServiceAuthError::SERVICE_ERROR:
case GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS: {
if (!sync_prefs_.SyncHasAuthError()) {
sync_prefs_.SetSyncAuthError(true);
@@ -785,6 +786,9 @@ void ProfileSyncService::OnGetTokenFailure(
// Fallthrough.
}
default: {
+ if (error.state() != GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS) {
+ LOG(ERROR) << "Unexpected persistent error: " << error.ToString();
+ }
// Show error to user.
UpdateAuthErrorState(error);
}
« no previous file with comments | « no previous file | chrome/browser/sync/test/integration/sync_auth_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698