OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |