| 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 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1105 blink::WebVector<blink::WebString> cors_exposed_header_names( | 1105 blink::WebVector<blink::WebString> cors_exposed_header_names( |
| 1106 info.cors_exposed_header_names.size()); | 1106 info.cors_exposed_header_names.size()); |
| 1107 std::transform( | 1107 std::transform( |
| 1108 info.cors_exposed_header_names.begin(), | 1108 info.cors_exposed_header_names.begin(), |
| 1109 info.cors_exposed_header_names.end(), cors_exposed_header_names.begin(), | 1109 info.cors_exposed_header_names.end(), cors_exposed_header_names.begin(), |
| 1110 [](const std::string& h) { return blink::WebString::FromLatin1(h); }); | 1110 [](const std::string& h) { return blink::WebString::FromLatin1(h); }); |
| 1111 response->SetCorsExposedHeaderNames(cors_exposed_header_names); | 1111 response->SetCorsExposedHeaderNames(cors_exposed_header_names); |
| 1112 response->SetDidServiceWorkerNavigationPreload( | 1112 response->SetDidServiceWorkerNavigationPreload( |
| 1113 info.did_service_worker_navigation_preload); | 1113 info.did_service_worker_navigation_preload); |
| 1114 response->SetEncodedDataLength(info.encoded_data_length); | 1114 response->SetEncodedDataLength(info.encoded_data_length); |
| 1115 response->SetAlpnNegotiatedProtocol( |
| 1116 WebString::FromUTF8(info.alpn_negotiated_protocol)); |
| 1117 response->SetConnectionInfo(info.connection_info); |
| 1115 | 1118 |
| 1116 SetSecurityStyleAndDetails(url, info, response, report_security_info); | 1119 SetSecurityStyleAndDetails(url, info, response, report_security_info); |
| 1117 | 1120 |
| 1118 WebURLResponseExtraDataImpl* extra_data = | 1121 WebURLResponseExtraDataImpl* extra_data = new WebURLResponseExtraDataImpl(); |
| 1119 new WebURLResponseExtraDataImpl(info.alpn_negotiated_protocol); | |
| 1120 response->SetExtraData(extra_data); | 1122 response->SetExtraData(extra_data); |
| 1121 extra_data->set_was_fetched_via_spdy(info.was_fetched_via_spdy); | 1123 extra_data->set_was_fetched_via_spdy(info.was_fetched_via_spdy); |
| 1122 extra_data->set_was_alpn_negotiated(info.was_alpn_negotiated); | 1124 extra_data->set_was_alpn_negotiated(info.was_alpn_negotiated); |
| 1123 extra_data->set_was_alternate_protocol_available( | 1125 extra_data->set_was_alternate_protocol_available( |
| 1124 info.was_alternate_protocol_available); | 1126 info.was_alternate_protocol_available); |
| 1125 extra_data->set_connection_info(info.connection_info); | |
| 1126 extra_data->set_previews_state(info.previews_state); | 1127 extra_data->set_previews_state(info.previews_state); |
| 1127 extra_data->set_effective_connection_type(info.effective_connection_type); | 1128 extra_data->set_effective_connection_type(info.effective_connection_type); |
| 1128 | 1129 |
| 1129 // If there's no received headers end time, don't set load timing. This is | 1130 // If there's no received headers end time, don't set load timing. This is |
| 1130 // the case for non-HTTP requests, requests that don't go over the wire, and | 1131 // the case for non-HTTP requests, requests that don't go over the wire, and |
| 1131 // certain error cases. | 1132 // certain error cases. |
| 1132 if (!info.load_timing.receive_headers_end.is_null()) { | 1133 if (!info.load_timing.receive_headers_end.is_null()) { |
| 1133 WebURLLoadTiming timing; | 1134 WebURLLoadTiming timing; |
| 1134 PopulateURLLoadTiming(info.load_timing, &timing); | 1135 PopulateURLLoadTiming(info.load_timing, &timing); |
| 1135 const TimeTicks kNullTicks; | 1136 const TimeTicks kNullTicks; |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1284 int intra_priority_value) { | 1285 int intra_priority_value) { |
| 1285 context_->DidChangePriority(new_priority, intra_priority_value); | 1286 context_->DidChangePriority(new_priority, intra_priority_value); |
| 1286 } | 1287 } |
| 1287 | 1288 |
| 1288 void WebURLLoaderImpl::SetLoadingTaskRunner( | 1289 void WebURLLoaderImpl::SetLoadingTaskRunner( |
| 1289 base::SingleThreadTaskRunner* loading_task_runner) { | 1290 base::SingleThreadTaskRunner* loading_task_runner) { |
| 1290 context_->SetTaskRunner(loading_task_runner); | 1291 context_->SetTaskRunner(loading_task_runner); |
| 1291 } | 1292 } |
| 1292 | 1293 |
| 1293 } // namespace content | 1294 } // namespace content |
| OLD | NEW |