| 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 <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 917 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 928 const net::URLRequestStatus& status, | 928 const net::URLRequestStatus& status, |
| 929 int response_code) { | 929 int response_code) { |
| 930 if (status.is_success() && response_code == net::HTTP_OK) { | 930 if (status.is_success() && response_code == net::HTTP_OK) { |
| 931 consumer_->OnGetCheckConnectionInfoSuccess(data); | 931 consumer_->OnGetCheckConnectionInfoSuccess(data); |
| 932 } else { | 932 } else { |
| 933 consumer_->OnGetCheckConnectionInfoError(GenerateAuthError(data, status)); | 933 consumer_->OnGetCheckConnectionInfoError(GenerateAuthError(data, status)); |
| 934 } | 934 } |
| 935 } | 935 } |
| 936 | 936 |
| 937 void GaiaAuthFetcher::OnURLFetchComplete(const net::URLFetcher* source) { | 937 void GaiaAuthFetcher::OnURLFetchComplete(const net::URLFetcher* source) { |
| 938 // TODO(vadimt): Remove ScopedTracker below once crbug.com/422577 is fixed. | |
| 939 tracked_objects::ScopedTracker tracking_profile( | |
| 940 FROM_HERE_WITH_EXPLICIT_FUNCTION( | |
| 941 "422577 GaiaAuthFetcher::OnURLFetchComplete")); | |
| 942 | |
| 943 fetch_pending_ = false; | 938 fetch_pending_ = false; |
| 944 // Some of the GAIA requests perform redirects, which results in the final | 939 // Some of the GAIA requests perform redirects, which results in the final |
| 945 // URL of the fetcher not being the original URL requested. Therefore use | 940 // URL of the fetcher not being the original URL requested. Therefore use |
| 946 // the original URL when determining which OnXXX function to call. | 941 // the original URL when determining which OnXXX function to call. |
| 947 const GURL& url = source->GetOriginalURL(); | 942 const GURL& url = source->GetOriginalURL(); |
| 948 const net::URLRequestStatus& status = source->GetStatus(); | 943 const net::URLRequestStatus& status = source->GetStatus(); |
| 949 int response_code = source->GetResponseCode(); | 944 int response_code = source->GetResponseCode(); |
| 950 std::string data; | 945 std::string data; |
| 951 source->GetResponseAsString(&data); | 946 source->GetResponseAsString(&data); |
| 952 #ifndef NDEBUG | 947 #ifndef NDEBUG |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 993 return alleged_error.find(kSecondFactor) != | 988 return alleged_error.find(kSecondFactor) != |
| 994 std::string::npos; | 989 std::string::npos; |
| 995 } | 990 } |
| 996 | 991 |
| 997 // static | 992 // static |
| 998 bool GaiaAuthFetcher::IsWebLoginRequiredSuccess( | 993 bool GaiaAuthFetcher::IsWebLoginRequiredSuccess( |
| 999 const std::string& alleged_error) { | 994 const std::string& alleged_error) { |
| 1000 return alleged_error.find(kWebLoginRequired) != | 995 return alleged_error.find(kWebLoginRequired) != |
| 1001 std::string::npos; | 996 std::string::npos; |
| 1002 } | 997 } |
| OLD | NEW |