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

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

Issue 2670013002: net: remove GetNormalizedHeaders() function (Closed)
Patch Set: n Created 3 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
« no previous file with comments | « google_apis/drive/base_requests.cc ('k') | net/http/http_cache_unittest.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 <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/json/json_reader.h" 11 #include "base/json/json_reader.h"
12 #include "base/json/json_writer.h" 12 #include "base/json/json_writer.h"
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "base/profiler/scoped_tracker.h" 14 #include "base/profiler/scoped_tracker.h"
15 #include "base/strings/string_split.h" 15 #include "base/strings/string_split.h"
16 #include "base/strings/string_util.h" 16 #include "base/strings/string_util.h"
17 #include "base/strings/stringprintf.h" 17 #include "base/strings/stringprintf.h"
18 #include "base/values.h" 18 #include "base/values.h"
19 #include "google_apis/gaia/gaia_auth_consumer.h" 19 #include "google_apis/gaia/gaia_auth_consumer.h"
20 #include "google_apis/gaia/gaia_auth_util.h" 20 #include "google_apis/gaia/gaia_auth_util.h"
21 #include "google_apis/gaia/gaia_constants.h" 21 #include "google_apis/gaia/gaia_constants.h"
22 #include "google_apis/gaia/gaia_urls.h" 22 #include "google_apis/gaia/gaia_urls.h"
23 #include "google_apis/gaia/google_service_auth_error.h" 23 #include "google_apis/gaia/google_service_auth_error.h"
24 #include "net/base/escape.h" 24 #include "net/base/escape.h"
25 #include "net/base/load_flags.h" 25 #include "net/base/load_flags.h"
26 #include "net/http/http_response_headers.h" 26 #include "net/http/http_response_headers.h"
27 #include "net/http/http_status_code.h" 27 #include "net/http/http_status_code.h"
28 #include "net/http/http_util.h"
28 #include "net/url_request/url_fetcher.h" 29 #include "net/url_request/url_fetcher.h"
29 #include "net/url_request/url_request_context_getter.h" 30 #include "net/url_request/url_request_context_getter.h"
30 #include "net/url_request/url_request_status.h" 31 #include "net/url_request/url_request_status.h"
31 32
32 namespace { 33 namespace {
33 const int kLoadFlagsIgnoreCookies = net::LOAD_DO_NOT_SEND_COOKIES | 34 const int kLoadFlagsIgnoreCookies = net::LOAD_DO_NOT_SEND_COOKIES |
34 net::LOAD_DO_NOT_SAVE_COOKIES; 35 net::LOAD_DO_NOT_SAVE_COOKIES;
35 36
36 static bool CookiePartsContains(const std::vector<std::string>& parts, 37 static bool CookiePartsContains(const std::vector<std::string>& parts,
37 const char* part) { 38 const char* part) {
(...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after
946 const net::URLRequestStatus& status = source->GetStatus(); 947 const net::URLRequestStatus& status = source->GetStatus();
947 int response_code = source->GetResponseCode(); 948 int response_code = source->GetResponseCode();
948 std::string data; 949 std::string data;
949 source->GetResponseAsString(&data); 950 source->GetResponseAsString(&data);
950 951
951 // Retrieve the response headers from the request. Must only be called after 952 // Retrieve the response headers from the request. Must only be called after
952 // the OnURLFetchComplete callback has run. 953 // the OnURLFetchComplete callback has run.
953 #ifndef NDEBUG 954 #ifndef NDEBUG
954 std::string headers; 955 std::string headers;
955 if (source->GetResponseHeaders()) 956 if (source->GetResponseHeaders())
956 source->GetResponseHeaders()->GetNormalizedHeaders(&headers); 957 headers = net::HttpUtil::ConvertHeadersBackToHTTPResponse(
958 source->GetResponseHeaders()->raw_headers());
957 DVLOG(2) << "Response " << url.spec() << ", code = " << response_code << "\n" 959 DVLOG(2) << "Response " << url.spec() << ", code = " << response_code << "\n"
958 << headers << "\n"; 960 << headers << "\n";
959 DVLOG(2) << "data: " << data << "\n"; 961 DVLOG(2) << "data: " << data << "\n";
960 #endif 962 #endif
961 963
962 net::ResponseCookies cookies; 964 net::ResponseCookies cookies;
963 GetCookiesFromResponse(source->GetResponseHeaders(), &cookies); 965 GetCookiesFromResponse(source->GetResponseHeaders(), &cookies);
964 DispatchFetchedRequest(url, data, cookies, status, response_code); 966 DispatchFetchedRequest(url, data, cookies, status, response_code);
965 } 967 }
966 968
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
1013 return alleged_error.find(kSecondFactor) != 1015 return alleged_error.find(kSecondFactor) !=
1014 std::string::npos; 1016 std::string::npos;
1015 } 1017 }
1016 1018
1017 // static 1019 // static
1018 bool GaiaAuthFetcher::IsWebLoginRequiredSuccess( 1020 bool GaiaAuthFetcher::IsWebLoginRequiredSuccess(
1019 const std::string& alleged_error) { 1021 const std::string& alleged_error) {
1020 return alleged_error.find(kWebLoginRequired) != 1022 return alleged_error.find(kWebLoginRequired) !=
1021 std::string::npos; 1023 std::string::npos;
1022 } 1024 }
OLDNEW
« no previous file with comments | « google_apis/drive/base_requests.cc ('k') | net/http/http_cache_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698