OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/child/web_url_loader_impl.h" | 5 #include "content/child/web_url_loader_impl.h" |
6 | 6 |
7 #include <openssl/ssl.h> | 7 #include <openssl/ssl.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 993 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1004 info.cors_exposed_header_names.size()); | 1004 info.cors_exposed_header_names.size()); |
1005 std::transform( | 1005 std::transform( |
1006 info.cors_exposed_header_names.begin(), | 1006 info.cors_exposed_header_names.begin(), |
1007 info.cors_exposed_header_names.end(), cors_exposed_header_names.begin(), | 1007 info.cors_exposed_header_names.end(), cors_exposed_header_names.begin(), |
1008 [](const std::string& h) { return blink::WebString::fromLatin1(h); }); | 1008 [](const std::string& h) { return blink::WebString::fromLatin1(h); }); |
1009 response->setCorsExposedHeaderNames(cors_exposed_header_names); | 1009 response->setCorsExposedHeaderNames(cors_exposed_header_names); |
1010 | 1010 |
1011 SetSecurityStyleAndDetails(url, info, response, report_security_info); | 1011 SetSecurityStyleAndDetails(url, info, response, report_security_info); |
1012 | 1012 |
1013 WebURLResponseExtraDataImpl* extra_data = | 1013 WebURLResponseExtraDataImpl* extra_data = |
1014 new WebURLResponseExtraDataImpl(info.npn_negotiated_protocol); | 1014 new WebURLResponseExtraDataImpl(info.alpn_negotiated_protocol); |
1015 response->setExtraData(extra_data); | 1015 response->setExtraData(extra_data); |
1016 extra_data->set_was_fetched_via_spdy(info.was_fetched_via_spdy); | 1016 extra_data->set_was_fetched_via_spdy(info.was_fetched_via_spdy); |
1017 extra_data->set_was_npn_negotiated(info.was_npn_negotiated); | 1017 extra_data->set_was_alpn_negotiated(info.was_alpn_negotiated); |
1018 extra_data->set_was_alternate_protocol_available( | 1018 extra_data->set_was_alternate_protocol_available( |
1019 info.was_alternate_protocol_available); | 1019 info.was_alternate_protocol_available); |
1020 extra_data->set_connection_info(info.connection_info); | 1020 extra_data->set_connection_info(info.connection_info); |
1021 extra_data->set_was_fetched_via_proxy(info.was_fetched_via_proxy); | 1021 extra_data->set_was_fetched_via_proxy(info.was_fetched_via_proxy); |
1022 extra_data->set_proxy_server(info.proxy_server); | 1022 extra_data->set_proxy_server(info.proxy_server); |
1023 extra_data->set_is_using_lofi(info.is_using_lofi); | 1023 extra_data->set_is_using_lofi(info.is_using_lofi); |
1024 extra_data->set_effective_connection_type(info.effective_connection_type); | 1024 extra_data->set_effective_connection_type(info.effective_connection_type); |
1025 | 1025 |
1026 // If there's no received headers end time, don't set load timing. This is | 1026 // If there's no received headers end time, don't set load timing. This is |
1027 // the case for non-HTTP requests, requests that don't go over the wire, and | 1027 // the case for non-HTTP requests, requests that don't go over the wire, and |
(...skipping 27 matching lines...) Expand all Loading... |
1055 load_info.addRequestHeader(WebString::fromLatin1(it->first), | 1055 load_info.addRequestHeader(WebString::fromLatin1(it->first), |
1056 WebString::fromLatin1(it->second)); | 1056 WebString::fromLatin1(it->second)); |
1057 } | 1057 } |
1058 const HeadersVector& response_headers = | 1058 const HeadersVector& response_headers = |
1059 info.devtools_info->response_headers; | 1059 info.devtools_info->response_headers; |
1060 for (HeadersVector::const_iterator it = response_headers.begin(); | 1060 for (HeadersVector::const_iterator it = response_headers.begin(); |
1061 it != response_headers.end(); ++it) { | 1061 it != response_headers.end(); ++it) { |
1062 load_info.addResponseHeader(WebString::fromLatin1(it->first), | 1062 load_info.addResponseHeader(WebString::fromLatin1(it->first), |
1063 WebString::fromLatin1(it->second)); | 1063 WebString::fromLatin1(it->second)); |
1064 } | 1064 } |
1065 load_info.setNPNNegotiatedProtocol(WebString::fromLatin1( | 1065 load_info.setNPNNegotiatedProtocol( |
1066 info.npn_negotiated_protocol)); | 1066 WebString::fromLatin1(info.alpn_negotiated_protocol)); |
1067 response->setHTTPLoadInfo(load_info); | 1067 response->setHTTPLoadInfo(load_info); |
1068 } | 1068 } |
1069 | 1069 |
1070 const net::HttpResponseHeaders* headers = info.headers.get(); | 1070 const net::HttpResponseHeaders* headers = info.headers.get(); |
1071 if (!headers) | 1071 if (!headers) |
1072 return; | 1072 return; |
1073 | 1073 |
1074 WebURLResponse::HTTPVersion version = WebURLResponse::HTTPVersionUnknown; | 1074 WebURLResponse::HTTPVersion version = WebURLResponse::HTTPVersionUnknown; |
1075 if (headers->GetHttpVersion() == net::HttpVersion(0, 9)) | 1075 if (headers->GetHttpVersion() == net::HttpVersion(0, 9)) |
1076 version = WebURLResponse::HTTPVersion_0_9; | 1076 version = WebURLResponse::HTTPVersion_0_9; |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1242 response->clearHTTPHeaderField(webStringName); | 1242 response->clearHTTPHeaderField(webStringName); |
1243 while (response_headers->EnumerateHeader(&iterator, name, &value)) { | 1243 while (response_headers->EnumerateHeader(&iterator, name, &value)) { |
1244 response->addHTTPHeaderField(webStringName, | 1244 response->addHTTPHeaderField(webStringName, |
1245 WebString::fromLatin1(value)); | 1245 WebString::fromLatin1(value)); |
1246 } | 1246 } |
1247 } | 1247 } |
1248 return true; | 1248 return true; |
1249 } | 1249 } |
1250 | 1250 |
1251 } // namespace content | 1251 } // namespace content |
OLD | NEW |