diff options
Diffstat (limited to 'chromium/google_apis/gaia/oauth2_access_token_fetcher_impl.cc')
-rw-r--r-- | chromium/google_apis/gaia/oauth2_access_token_fetcher_impl.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/chromium/google_apis/gaia/oauth2_access_token_fetcher_impl.cc b/chromium/google_apis/gaia/oauth2_access_token_fetcher_impl.cc index 49f3e0db052..4668c30dd5e 100644 --- a/chromium/google_apis/gaia/oauth2_access_token_fetcher_impl.cc +++ b/chromium/google_apis/gaia/oauth2_access_token_fetcher_impl.cc @@ -207,7 +207,8 @@ void OAuth2AccessTokenFetcherImpl::EndGetAccessToken( bool net_failure = false; int histogram_value; - if (url_loader_->ResponseInfo() && url_loader_->ResponseInfo()->headers) { + if (url_loader_->NetError() == net::OK && url_loader_->ResponseInfo() && + url_loader_->ResponseInfo()->headers) { // Note that the SimpleURLLoader reports net::ERR_FAILED for HTTP codes // other than 200s. histogram_value = url_loader_->ResponseInfo()->headers->response_code(); @@ -226,6 +227,13 @@ void OAuth2AccessTokenFetcherImpl::EndGetAccessToken( switch (response_code) { case net::HTTP_OK: break; + case net::HTTP_PROXY_AUTHENTICATION_REQUIRED: + NOTREACHED() << "HTTP 407 should be treated as a network error."; + // If this ever happens in production, we treat it as a temporary error as + // it is similar to a network error. + OnGetTokenFailure( + GoogleServiceAuthError(GoogleServiceAuthError::SERVICE_UNAVAILABLE)); + return; case net::HTTP_FORBIDDEN: // HTTP_FORBIDDEN (403) is treated as temporary error, because it may be // '403 Rate Limit Exeeded.' |