| 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 1031 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1042 ? blink::WebString::fromUTF8(info.cache_storage_cache_name) | 1042 ? blink::WebString::fromUTF8(info.cache_storage_cache_name) |
| 1043 : blink::WebString()); | 1043 : blink::WebString()); |
| 1044 blink::WebVector<blink::WebString> cors_exposed_header_names( | 1044 blink::WebVector<blink::WebString> cors_exposed_header_names( |
| 1045 info.cors_exposed_header_names.size()); | 1045 info.cors_exposed_header_names.size()); |
| 1046 std::transform( | 1046 std::transform( |
| 1047 info.cors_exposed_header_names.begin(), | 1047 info.cors_exposed_header_names.begin(), |
| 1048 info.cors_exposed_header_names.end(), cors_exposed_header_names.begin(), | 1048 info.cors_exposed_header_names.end(), cors_exposed_header_names.begin(), |
| 1049 [](const std::string& h) { return blink::WebString::fromLatin1(h); }); | 1049 [](const std::string& h) { return blink::WebString::fromLatin1(h); }); |
| 1050 response->setCorsExposedHeaderNames(cors_exposed_header_names); | 1050 response->setCorsExposedHeaderNames(cors_exposed_header_names); |
| 1051 response->addToEncodedDataLength(info.encoded_data_length); | 1051 response->addToEncodedDataLength(info.encoded_data_length); |
| 1052 response->setALPNNegotiatedProtocol( |
| 1053 WebString::fromUTF8(info.alpn_negotiated_protocol)); |
| 1054 response->setConnectionInfo(WebString::fromUTF8( |
| 1055 net::HttpResponseInfo::ConnectionInfoToString(info.connection_info))); |
| 1052 | 1056 |
| 1053 SetSecurityStyleAndDetails(url, info, response, report_security_info); | 1057 SetSecurityStyleAndDetails(url, info, response, report_security_info); |
| 1054 | 1058 |
| 1055 WebURLResponseExtraDataImpl* extra_data = | 1059 WebURLResponseExtraDataImpl* extra_data = new WebURLResponseExtraDataImpl(); |
| 1056 new WebURLResponseExtraDataImpl(info.alpn_negotiated_protocol); | |
| 1057 response->setExtraData(extra_data); | 1060 response->setExtraData(extra_data); |
| 1061 |
| 1058 extra_data->set_was_fetched_via_spdy(info.was_fetched_via_spdy); | 1062 extra_data->set_was_fetched_via_spdy(info.was_fetched_via_spdy); |
| 1059 extra_data->set_was_alpn_negotiated(info.was_alpn_negotiated); | 1063 extra_data->set_was_alpn_negotiated(info.was_alpn_negotiated); |
| 1060 extra_data->set_was_alternate_protocol_available( | 1064 extra_data->set_was_alternate_protocol_available( |
| 1061 info.was_alternate_protocol_available); | 1065 info.was_alternate_protocol_available); |
| 1062 extra_data->set_connection_info(info.connection_info); | |
| 1063 extra_data->set_is_using_lofi(info.is_using_lofi); | 1066 extra_data->set_is_using_lofi(info.is_using_lofi); |
| 1064 extra_data->set_effective_connection_type(info.effective_connection_type); | 1067 extra_data->set_effective_connection_type(info.effective_connection_type); |
| 1065 | 1068 |
| 1066 // If there's no received headers end time, don't set load timing. This is | 1069 // If there's no received headers end time, don't set load timing. This is |
| 1067 // the case for non-HTTP requests, requests that don't go over the wire, and | 1070 // the case for non-HTTP requests, requests that don't go over the wire, and |
| 1068 // certain error cases. | 1071 // certain error cases. |
| 1069 if (!info.load_timing.receive_headers_end.is_null()) { | 1072 if (!info.load_timing.receive_headers_end.is_null()) { |
| 1070 WebURLLoadTiming timing; | 1073 WebURLLoadTiming timing; |
| 1071 PopulateURLLoadTiming(info.load_timing, &timing); | 1074 PopulateURLLoadTiming(info.load_timing, &timing); |
| 1072 const TimeTicks kNullTicks; | 1075 const TimeTicks kNullTicks; |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1234 int intra_priority_value) { | 1237 int intra_priority_value) { |
| 1235 context_->DidChangePriority(new_priority, intra_priority_value); | 1238 context_->DidChangePriority(new_priority, intra_priority_value); |
| 1236 } | 1239 } |
| 1237 | 1240 |
| 1238 void WebURLLoaderImpl::setLoadingTaskRunner( | 1241 void WebURLLoaderImpl::setLoadingTaskRunner( |
| 1239 blink::WebTaskRunner* loading_task_runner) { | 1242 blink::WebTaskRunner* loading_task_runner) { |
| 1240 context_->SetTaskRunner(loading_task_runner->toSingleThreadTaskRunner()); | 1243 context_->SetTaskRunner(loading_task_runner->toSingleThreadTaskRunner()); |
| 1241 } | 1244 } |
| 1242 | 1245 |
| 1243 } // namespace content | 1246 } // namespace content |
| OLD | NEW |