summaryrefslogtreecommitdiffstats
path: root/google_apis
diff options
context:
space:
mode:
authorjoaodasilva@chromium.org <joaodasilva@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-04 23:15:33 +0000
committerjoaodasilva@chromium.org <joaodasilva@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-04 23:15:33 +0000
commit9d7a393e71d5f0eef42500552e770709506050ae (patch)
tree7b821244b11bfa96eef1c64a102570682ddef976 /google_apis
parentd32024d7ddcc198b7f983d0b443492859e1f3036 (diff)
downloadchromium_src-9d7a393e71d5f0eef42500552e770709506050ae.zip
chromium_src-9d7a393e71d5f0eef42500552e770709506050ae.tar.gz
chromium_src-9d7a393e71d5f0eef42500552e770709506050ae.tar.bz2
Make gaia and oauth token fetchers recover from ERR_NETWORK_CHANGED.
This net error occurs frequently during ChromeOS sign-in when tokens are being fetched, due to network change notifications triggered by the network library, the portal detector and sometimes proxy configuration changes. BUG=173671 Review URL: https://chromiumcodereview.appspot.com/12161003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180550 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'google_apis')
-rw-r--r--google_apis/gaia/gaia_auth_fetcher.cc6
-rw-r--r--google_apis/gaia/oauth2_access_token_fetcher.cc5
-rw-r--r--google_apis/gaia/oauth2_api_call_flow.cc5
-rw-r--r--google_apis/gaia/oauth2_mint_token_fetcher.cc5
-rw-r--r--google_apis/gaia/oauth2_revocation_fetcher.cc5
5 files changed, 26 insertions, 0 deletions
diff --git a/google_apis/gaia/gaia_auth_fetcher.cc b/google_apis/gaia/gaia_auth_fetcher.cc
index 853e6c9..b4f7df6 100644
--- a/google_apis/gaia/gaia_auth_fetcher.cc
+++ b/google_apis/gaia/gaia_auth_fetcher.cc
@@ -227,6 +227,12 @@ net::URLFetcher* GaiaAuthFetcher::CreateGaiaFetcher(
// explicitly.
to_return->SetLoadFlags(load_flags);
+ // 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
+ to_return->SetAutomaticallyRetryOnNetworkChanges(3);
+
if (!headers.empty())
to_return->SetExtraRequestHeaders(headers);
diff --git a/google_apis/gaia/oauth2_access_token_fetcher.cc b/google_apis/gaia/oauth2_access_token_fetcher.cc
index 679891c..0cd4456 100644
--- a/google_apis/gaia/oauth2_access_token_fetcher.cc
+++ b/google_apis/gaia/oauth2_access_token_fetcher.cc
@@ -69,6 +69,11 @@ static URLFetcher* CreateFetcher(URLRequestContextGetter* getter,
result->SetRequestContext(getter);
result->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES |
net::LOAD_DO_NOT_SAVE_COOKIES);
+ // 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
+ result->SetAutomaticallyRetryOnNetworkChanges(3);
if (!empty_body)
result->SetUploadData("application/x-www-form-urlencoded", body);
diff --git a/google_apis/gaia/oauth2_api_call_flow.cc b/google_apis/gaia/oauth2_api_call_flow.cc
index 9037764..f8a804d 100644
--- a/google_apis/gaia/oauth2_api_call_flow.cc
+++ b/google_apis/gaia/oauth2_api_call_flow.cc
@@ -159,6 +159,11 @@ URLFetcher* OAuth2ApiCallFlow::CreateURLFetcher() {
result->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES |
net::LOAD_DO_NOT_SAVE_COOKIES);
result->AddExtraRequestHeader(MakeAuthorizationHeader(access_token_));
+ // 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
+ result->SetAutomaticallyRetryOnNetworkChanges(3);
if (!empty_body)
result->SetUploadData("application/x-www-form-urlencoded", body);
diff --git a/google_apis/gaia/oauth2_mint_token_fetcher.cc b/google_apis/gaia/oauth2_mint_token_fetcher.cc
index 425a126..051f9ab 100644
--- a/google_apis/gaia/oauth2_mint_token_fetcher.cc
+++ b/google_apis/gaia/oauth2_mint_token_fetcher.cc
@@ -62,6 +62,11 @@ static URLFetcher* CreateFetcher(URLRequestContextGetter* getter,
result->SetRequestContext(getter);
result->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES |
net::LOAD_DO_NOT_SAVE_COOKIES);
+ // 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
+ result->SetAutomaticallyRetryOnNetworkChanges(3);
if (!empty_body)
result->SetUploadData("application/x-www-form-urlencoded", body);
diff --git a/google_apis/gaia/oauth2_revocation_fetcher.cc b/google_apis/gaia/oauth2_revocation_fetcher.cc
index 2a4bae5..f5c7df1 100644
--- a/google_apis/gaia/oauth2_revocation_fetcher.cc
+++ b/google_apis/gaia/oauth2_revocation_fetcher.cc
@@ -62,6 +62,11 @@ static URLFetcher* CreateFetcher(URLRequestContextGetter* getter,
result->SetRequestContext(getter);
result->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES |
net::LOAD_DO_NOT_SAVE_COOKIES);
+ // 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
+ result->SetAutomaticallyRetryOnNetworkChanges(3);
if (!header.empty())
result->SetExtraRequestHeaders(header);