diff options
author | joaodasilva@chromium.org <joaodasilva@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-14 22:40:42 +0000 |
---|---|---|
committer | joaodasilva@chromium.org <joaodasilva@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-14 22:40:42 +0000 |
commit | 7af985a498165e9ba74d7e428be4ffe9a054f053 (patch) | |
tree | 88a20282a57a9b0bffc1d99f34e0ba7ae65f4063 /google_apis | |
parent | ab108f2658ea9da9572085ea8bd501505f3f38c5 (diff) | |
download | chromium_src-7af985a498165e9ba74d7e428be4ffe9a054f053.zip chromium_src-7af985a498165e9ba74d7e428be4ffe9a054f053.tar.gz chromium_src-7af985a498165e9ba74d7e428be4ffe9a054f053.tar.bz2 |
Introduce ERR_NETWORK_CHANGED and allow URLFetcher to automatically retry on that error.
BUG=164363
Review URL: https://codereview.chromium.org/11464028
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173227 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'google_apis')
-rw-r--r-- | google_apis/gaia/gaia_oauth_client.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/google_apis/gaia/gaia_oauth_client.cc b/google_apis/gaia/gaia_oauth_client.cc index 46fbac1..1adefb8 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 { |