| 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 <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 1059 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1070 blink::WebVector<blink::WebString> cors_exposed_header_names( | 1070 blink::WebVector<blink::WebString> cors_exposed_header_names( |
| 1071 info.cors_exposed_header_names.size()); | 1071 info.cors_exposed_header_names.size()); |
| 1072 std::transform( | 1072 std::transform( |
| 1073 info.cors_exposed_header_names.begin(), | 1073 info.cors_exposed_header_names.begin(), |
| 1074 info.cors_exposed_header_names.end(), cors_exposed_header_names.begin(), | 1074 info.cors_exposed_header_names.end(), cors_exposed_header_names.begin(), |
| 1075 [](const std::string& h) { return blink::WebString::fromLatin1(h); }); | 1075 [](const std::string& h) { return blink::WebString::fromLatin1(h); }); |
| 1076 response->setCorsExposedHeaderNames(cors_exposed_header_names); | 1076 response->setCorsExposedHeaderNames(cors_exposed_header_names); |
| 1077 response->setDidServiceWorkerNavigationPreload( | 1077 response->setDidServiceWorkerNavigationPreload( |
| 1078 info.did_service_worker_navigation_preload); | 1078 info.did_service_worker_navigation_preload); |
| 1079 response->setEncodedDataLength(info.encoded_data_length); | 1079 response->setEncodedDataLength(info.encoded_data_length); |
| 1080 response->setALPNNegotiatedProtocol( |
| 1081 WebString::fromUTF8(info.alpn_negotiated_protocol)); |
| 1082 response->setConnectionInfo(WebString::fromUTF8( |
| 1083 net::HttpResponseInfo::ConnectionInfoToString(info.connection_info))); |
| 1080 | 1084 |
| 1081 SetSecurityStyleAndDetails(url, info, response, report_security_info); | 1085 SetSecurityStyleAndDetails(url, info, response, report_security_info); |
| 1082 | 1086 |
| 1083 WebURLResponseExtraDataImpl* extra_data = | 1087 WebURLResponseExtraDataImpl* extra_data = new WebURLResponseExtraDataImpl(); |
| 1084 new WebURLResponseExtraDataImpl(info.alpn_negotiated_protocol); | |
| 1085 response->setExtraData(extra_data); | 1088 response->setExtraData(extra_data); |
| 1089 |
| 1086 extra_data->set_was_fetched_via_spdy(info.was_fetched_via_spdy); | 1090 extra_data->set_was_fetched_via_spdy(info.was_fetched_via_spdy); |
| 1087 extra_data->set_was_alpn_negotiated(info.was_alpn_negotiated); | 1091 extra_data->set_was_alpn_negotiated(info.was_alpn_negotiated); |
| 1088 extra_data->set_was_alternate_protocol_available( | 1092 extra_data->set_was_alternate_protocol_available( |
| 1089 info.was_alternate_protocol_available); | 1093 info.was_alternate_protocol_available); |
| 1090 extra_data->set_connection_info(info.connection_info); | |
| 1091 extra_data->set_previews_state(info.previews_state); | 1094 extra_data->set_previews_state(info.previews_state); |
| 1092 extra_data->set_effective_connection_type(info.effective_connection_type); | 1095 extra_data->set_effective_connection_type(info.effective_connection_type); |
| 1093 | 1096 |
| 1094 // If there's no received headers end time, don't set load timing. This is | 1097 // If there's no received headers end time, don't set load timing. This is |
| 1095 // the case for non-HTTP requests, requests that don't go over the wire, and | 1098 // the case for non-HTTP requests, requests that don't go over the wire, and |
| 1096 // certain error cases. | 1099 // certain error cases. |
| 1097 if (!info.load_timing.receive_headers_end.is_null()) { | 1100 if (!info.load_timing.receive_headers_end.is_null()) { |
| 1098 WebURLLoadTiming timing; | 1101 WebURLLoadTiming timing; |
| 1099 PopulateURLLoadTiming(info.load_timing, &timing); | 1102 PopulateURLLoadTiming(info.load_timing, &timing); |
| 1100 const TimeTicks kNullTicks; | 1103 const TimeTicks kNullTicks; |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1249 int intra_priority_value) { | 1252 int intra_priority_value) { |
| 1250 context_->DidChangePriority(new_priority, intra_priority_value); | 1253 context_->DidChangePriority(new_priority, intra_priority_value); |
| 1251 } | 1254 } |
| 1252 | 1255 |
| 1253 void WebURLLoaderImpl::setLoadingTaskRunner( | 1256 void WebURLLoaderImpl::setLoadingTaskRunner( |
| 1254 base::SingleThreadTaskRunner* loading_task_runner) { | 1257 base::SingleThreadTaskRunner* loading_task_runner) { |
| 1255 context_->SetTaskRunner(loading_task_runner); | 1258 context_->SetTaskRunner(loading_task_runner); |
| 1256 } | 1259 } |
| 1257 | 1260 |
| 1258 } // namespace content | 1261 } // namespace content |
| OLD | NEW |