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

Unified Diff: google_apis/gaia/gaia_oauth_client.cc

Issue 11464028: Introduce ERR_NETWORK_CHANGED and allow URLFetcher to automatically retry on that error. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed nits Created 8 years 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 | « chrome/service/cloud_print/cloud_print_url_fetcher.cc ('k') | net/base/dnsrr_resolver.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: google_apis/gaia/gaia_oauth_client.cc
diff --git a/google_apis/gaia/gaia_oauth_client.cc b/google_apis/gaia/gaia_oauth_client.cc
index 46fbac166db1208a90814aa87fde72baa6bb4f00..1adefb8b19b3a124d747e009aa28edb7476d0fc5 100644
--- a/google_apis/gaia/gaia_oauth_client.cc
+++ b/google_apis/gaia/gaia_oauth_client.cc
@@ -128,7 +128,7 @@ void GaiaOAuthClient::Core::GetUserInfo(const std::string& oauth_access_token,
request_->SetRequestContext(request_context_getter_);
request_->AddExtraRequestHeader(
"Authorization: OAuth " + oauth_access_token);
- request_->SetMaxRetries(max_retries);
+ request_->SetMaxRetriesOn5xx(max_retries);
request_->Start();
}
@@ -143,7 +143,7 @@ void GaiaOAuthClient::Core::MakeGaiaRequest(
0, gaia_url_, net::URLFetcher::POST, this));
request_->SetRequestContext(request_context_getter_);
request_->SetUploadData("application/x-www-form-urlencoded", post_body);
- request_->SetMaxRetries(max_retries);
+ request_->SetMaxRetriesOn5xx(max_retries);
request_->Start();
}
@@ -195,8 +195,8 @@ void GaiaOAuthClient::Core::HandleResponse(
if (!response_dict.get()) {
// If we don't have an access token yet and the the error was not
// RC_BAD_REQUEST, we may need to retry.
- if ((source->GetMaxRetries() != -1) &&
- (num_retries_ > source->GetMaxRetries())) {
+ if ((source->GetMaxRetriesOn5xx() != -1) &&
+ (num_retries_ > source->GetMaxRetriesOn5xx())) {
// Retry limit reached. Give up.
delegate_->OnNetworkError(source->GetResponseCode());
} else {
« no previous file with comments | « chrome/service/cloud_print/cloud_print_url_fetcher.cc ('k') | net/base/dnsrr_resolver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698