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

Side by Side Diff: google_apis/gaia/gaia_auth_fetcher.cc

Issue 12161003: Make gaia and oauth token fetchers recover from ERR_NETWORK_CHANGED. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | google_apis/gaia/oauth2_access_token_fetcher.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "google_apis/gaia/gaia_auth_fetcher.h" 5 #include "google_apis/gaia/gaia_auth_fetcher.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 DVLOG(2) << "Gaia fetcher headers: " << headers; 220 DVLOG(2) << "Gaia fetcher headers: " << headers;
221 DVLOG(2) << "Gaia fetcher body: " << body; 221 DVLOG(2) << "Gaia fetcher body: " << body;
222 222
223 // The Gaia token exchange requests do not require any cookie-based 223 // The Gaia token exchange requests do not require any cookie-based
224 // identification as part of requests. We suppress sending any cookies to 224 // identification as part of requests. We suppress sending any cookies to
225 // maintain a separation between the user's browsing and Chrome's internal 225 // maintain a separation between the user's browsing and Chrome's internal
226 // services. Where such mixing is desired (MergeSession), it will be done 226 // services. Where such mixing is desired (MergeSession), it will be done
227 // explicitly. 227 // explicitly.
228 to_return->SetLoadFlags(load_flags); 228 to_return->SetLoadFlags(load_flags);
229 229
230 // Fetchers are sometimes cancelled because a network change was detected,
231 // especially at startup and after sign-in on ChromeOS. Retrying once should
232 // be enough in those cases; let the fetcher retry up to 3 times just in case.
233 // http://crbug.com/163710
234 to_return->SetAutomaticallyRetryOnNetworkChanges(3);
235
230 if (!headers.empty()) 236 if (!headers.empty())
231 to_return->SetExtraRequestHeaders(headers); 237 to_return->SetExtraRequestHeaders(headers);
232 238
233 return to_return; 239 return to_return;
234 } 240 }
235 241
236 // static 242 // static
237 std::string GaiaAuthFetcher::MakeClientLoginBody( 243 std::string GaiaAuthFetcher::MakeClientLoginBody(
238 const std::string& username, 244 const std::string& username,
239 const std::string& password, 245 const std::string& password,
(...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after
1116 NOTREACHED(); 1122 NOTREACHED();
1117 } 1123 }
1118 } 1124 }
1119 1125
1120 // static 1126 // static
1121 bool GaiaAuthFetcher::IsSecondFactorSuccess( 1127 bool GaiaAuthFetcher::IsSecondFactorSuccess(
1122 const std::string& alleged_error) { 1128 const std::string& alleged_error) {
1123 return alleged_error.find(kSecondFactor) != 1129 return alleged_error.find(kSecondFactor) !=
1124 std::string::npos; 1130 std::string::npos;
1125 } 1131 }
OLDNEW
« no previous file with comments | « no previous file | google_apis/gaia/oauth2_access_token_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698