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

Unified Diff: chrome/browser/google_apis/auth_service.cc

Issue 12630010: Files.app: Treats HTTP_FORBIDDEN (403) as temporary error on authentication. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test failure Created 7 years, 9 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
Index: chrome/browser/google_apis/auth_service.cc
diff --git a/chrome/browser/google_apis/auth_service.cc b/chrome/browser/google_apis/auth_service.cc
index 5f93629ea812449e07b54d5ab1950cbffe3b3d17..5fb137efaafcfe6ecbd182ab0904561147ab1d14 100644
--- a/chrome/browser/google_apis/auth_service.cc
+++ b/chrome/browser/google_apis/auth_service.cc
@@ -40,7 +40,8 @@ namespace {
const int kSuccessRatioHistogramFailure = 0;
const int kSuccessRatioHistogramSuccess = 1;
const int kSuccessRatioHistogramNoConnection = 2;
-const int kSuccessRatioHistogramMaxValue = 3; // The max value is exclusive.
+const int kSuccessRatioHistogramTemporaryFailure = 3;
+const int kSuccessRatioHistogramMaxValue = 4; // The max value is exclusive.
} // namespace
@@ -136,7 +137,14 @@ void AuthOperation::OnGetTokenFailure(const GoogleServiceAuthError& error) {
kSuccessRatioHistogramNoConnection,
kSuccessRatioHistogramMaxValue);
callback_.Run(GDATA_NO_CONNECTION, std::string());
+ } else if (error.state() == GoogleServiceAuthError::SERVICE_UNAVAILABLE) {
+ // Temporary auth error.
+ UMA_HISTOGRAM_ENUMERATION("GData.AuthSuccess",
+ kSuccessRatioHistogramTemporaryFailure,
+ kSuccessRatioHistogramMaxValue);
+ callback_.Run(HTTP_FORBIDDEN, std::string());
} else {
+ // Permanent auth error.
UMA_HISTOGRAM_ENUMERATION("GData.AuthSuccess",
kSuccessRatioHistogramFailure,
kSuccessRatioHistogramMaxValue);
« no previous file with comments | « chrome/browser/chromeos/login/login_utils_browsertest.cc ('k') | google_apis/gaia/oauth2_access_token_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698