| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/net/gaia/gaia_oauth_fetcher.h" | 5 #include "chrome/browser/net/gaia/gaia_oauth_fetcher.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 | 449 |
| 450 // static | 450 // static |
| 451 GoogleServiceAuthError GaiaOAuthFetcher::GenerateAuthError( | 451 GoogleServiceAuthError GaiaOAuthFetcher::GenerateAuthError( |
| 452 const std::string& data, | 452 const std::string& data, |
| 453 const net::URLRequestStatus& status) { | 453 const net::URLRequestStatus& status) { |
| 454 if (!status.is_success()) { | 454 if (!status.is_success()) { |
| 455 if (status.status() == net::URLRequestStatus::CANCELED) { | 455 if (status.status() == net::URLRequestStatus::CANCELED) { |
| 456 return GoogleServiceAuthError(GoogleServiceAuthError::REQUEST_CANCELED); | 456 return GoogleServiceAuthError(GoogleServiceAuthError::REQUEST_CANCELED); |
| 457 } else { | 457 } else { |
| 458 LOG(WARNING) << "Could not reach Google Accounts servers: errno " | 458 LOG(WARNING) << "Could not reach Google Accounts servers: errno " |
| 459 << status.os_error(); | 459 << status.error(); |
| 460 return GoogleServiceAuthError::FromConnectionError(status.os_error()); | 460 return GoogleServiceAuthError::FromConnectionError(status.error()); |
| 461 } | 461 } |
| 462 } else { | 462 } else { |
| 463 LOG(WARNING) << "Unrecognized response from Google Accounts servers."; | 463 LOG(WARNING) << "Unrecognized response from Google Accounts servers."; |
| 464 return GoogleServiceAuthError( | 464 return GoogleServiceAuthError( |
| 465 GoogleServiceAuthError::SERVICE_UNAVAILABLE); | 465 GoogleServiceAuthError::SERVICE_UNAVAILABLE); |
| 466 } | 466 } |
| 467 | 467 |
| 468 NOTREACHED(); | 468 NOTREACHED(); |
| 469 return GoogleServiceAuthError(GoogleServiceAuthError::SERVICE_UNAVAILABLE); | 469 return GoogleServiceAuthError(GoogleServiceAuthError::SERVICE_UNAVAILABLE); |
| 470 } | 470 } |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 651 } else if (url.spec() == kUserInfoUrl) { | 651 } else if (url.spec() == kUserInfoUrl) { |
| 652 OnUserInfoFetched(data, status, response_code); | 652 OnUserInfoFetched(data, status, response_code); |
| 653 } else { | 653 } else { |
| 654 NOTREACHED(); | 654 NOTREACHED(); |
| 655 } | 655 } |
| 656 } | 656 } |
| 657 | 657 |
| 658 bool GaiaOAuthFetcher::ShouldAutoFetch(AutoFetchLimit fetch_step) { | 658 bool GaiaOAuthFetcher::ShouldAutoFetch(AutoFetchLimit fetch_step) { |
| 659 return fetch_step <= auto_fetch_limit_; | 659 return fetch_step <= auto_fetch_limit_; |
| 660 } | 660 } |
| OLD | NEW |