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

Unified Diff: google_apis/gaia/gaia_oauth_client.cc

Issue 11572044: Automatically retry the following URLFetchers when the network changes: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Document the retry behavior 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/browser/policy/device_management_service.cc ('k') | no next file » | 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 1adefb8b19b3a124d747e009aa28edb7476d0fc5..a9bae4f36bfe807186d6a912ab1be7ecf2d61de5 100644
--- a/google_apis/gaia/gaia_oauth_client.cc
+++ b/google_apis/gaia/gaia_oauth_client.cc
@@ -129,6 +129,11 @@ void GaiaOAuthClient::Core::GetUserInfo(const std::string& oauth_access_token,
request_->AddExtraRequestHeader(
"Authorization: OAuth " + oauth_access_token);
request_->SetMaxRetriesOn5xx(max_retries);
+ // Fetchers are sometimes cancelled because a network change was detected,
+ // especially at startup and after sign-in on ChromeOS. Retrying once should
+ // be enough in those cases; let the fetcher retry up to 3 times just in case.
+ // http://crbug.com/163710
+ request_->SetAutomaticallyRetryOnNetworkChanges(3);
request_->Start();
}
@@ -144,6 +149,8 @@ void GaiaOAuthClient::Core::MakeGaiaRequest(
request_->SetRequestContext(request_context_getter_);
request_->SetUploadData("application/x-www-form-urlencoded", post_body);
request_->SetMaxRetriesOn5xx(max_retries);
+ // See comment on SetAutomaticallyRetryOnNetworkChanges() above.
+ request_->SetAutomaticallyRetryOnNetworkChanges(3);
request_->Start();
}
« no previous file with comments | « chrome/browser/policy/device_management_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698