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 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
595 resource_request->download_to_file = request.downloadToFile(); | 595 resource_request->download_to_file = request.downloadToFile(); |
596 resource_request->has_user_gesture = request.hasUserGesture(); | 596 resource_request->has_user_gesture = request.hasUserGesture(); |
597 resource_request->enable_load_timing = true; | 597 resource_request->enable_load_timing = true; |
598 resource_request->enable_upload_progress = request.reportUploadProgress(); | 598 resource_request->enable_upload_progress = request.reportUploadProgress(); |
599 if (request.getRequestContext() == | 599 if (request.getRequestContext() == |
600 WebURLRequest::RequestContextXMLHttpRequest && | 600 WebURLRequest::RequestContextXMLHttpRequest && |
601 (url.has_username() || url.has_password())) { | 601 (url.has_username() || url.has_password())) { |
602 resource_request->do_not_prompt_for_login = true; | 602 resource_request->do_not_prompt_for_login = true; |
603 } | 603 } |
604 resource_request->report_raw_headers = request.reportRawHeaders(); | 604 resource_request->report_raw_headers = request.reportRawHeaders(); |
605 resource_request->lofi_state = static_cast<LoFiState>(request.getLoFiState()); | 605 resource_request->previews_state = |
| 606 static_cast<PreviewsState>(request.getPreviewsState()); |
606 | 607 |
607 // PlzNavigate: during navigation, the renderer should request a stream which | 608 // PlzNavigate: during navigation, the renderer should request a stream which |
608 // contains the body of the response. The network request has already been | 609 // contains the body of the response. The network request has already been |
609 // made by the browser. | 610 // made by the browser. |
610 if (stream_override_.get()) { | 611 if (stream_override_.get()) { |
611 CHECK(IsBrowserSideNavigationEnabled()); | 612 CHECK(IsBrowserSideNavigationEnabled()); |
612 DCHECK(!sync_load_response); | 613 DCHECK(!sync_load_response); |
613 DCHECK_NE(WebURLRequest::FrameTypeNone, request.getFrameType()); | 614 DCHECK_NE(WebURLRequest::FrameTypeNone, request.getFrameType()); |
614 resource_request->resource_body_stream_url = stream_override_->stream_url; | 615 resource_request->resource_body_stream_url = stream_override_->stream_url; |
615 } | 616 } |
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1078 SetSecurityStyleAndDetails(url, info, response, report_security_info); | 1079 SetSecurityStyleAndDetails(url, info, response, report_security_info); |
1079 | 1080 |
1080 WebURLResponseExtraDataImpl* extra_data = | 1081 WebURLResponseExtraDataImpl* extra_data = |
1081 new WebURLResponseExtraDataImpl(info.alpn_negotiated_protocol); | 1082 new WebURLResponseExtraDataImpl(info.alpn_negotiated_protocol); |
1082 response->setExtraData(extra_data); | 1083 response->setExtraData(extra_data); |
1083 extra_data->set_was_fetched_via_spdy(info.was_fetched_via_spdy); | 1084 extra_data->set_was_fetched_via_spdy(info.was_fetched_via_spdy); |
1084 extra_data->set_was_alpn_negotiated(info.was_alpn_negotiated); | 1085 extra_data->set_was_alpn_negotiated(info.was_alpn_negotiated); |
1085 extra_data->set_was_alternate_protocol_available( | 1086 extra_data->set_was_alternate_protocol_available( |
1086 info.was_alternate_protocol_available); | 1087 info.was_alternate_protocol_available); |
1087 extra_data->set_connection_info(info.connection_info); | 1088 extra_data->set_connection_info(info.connection_info); |
1088 extra_data->set_is_using_lofi(info.is_using_lofi); | 1089 extra_data->set_previews_state(info.previews_state); |
1089 extra_data->set_effective_connection_type(info.effective_connection_type); | 1090 extra_data->set_effective_connection_type(info.effective_connection_type); |
1090 | 1091 |
1091 // If there's no received headers end time, don't set load timing. This is | 1092 // If there's no received headers end time, don't set load timing. This is |
1092 // the case for non-HTTP requests, requests that don't go over the wire, and | 1093 // the case for non-HTTP requests, requests that don't go over the wire, and |
1093 // certain error cases. | 1094 // certain error cases. |
1094 if (!info.load_timing.receive_headers_end.is_null()) { | 1095 if (!info.load_timing.receive_headers_end.is_null()) { |
1095 WebURLLoadTiming timing; | 1096 WebURLLoadTiming timing; |
1096 PopulateURLLoadTiming(info.load_timing, &timing); | 1097 PopulateURLLoadTiming(info.load_timing, &timing); |
1097 const TimeTicks kNullTicks; | 1098 const TimeTicks kNullTicks; |
1098 timing.setWorkerStart( | 1099 timing.setWorkerStart( |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1259 int intra_priority_value) { | 1260 int intra_priority_value) { |
1260 context_->DidChangePriority(new_priority, intra_priority_value); | 1261 context_->DidChangePriority(new_priority, intra_priority_value); |
1261 } | 1262 } |
1262 | 1263 |
1263 void WebURLLoaderImpl::setLoadingTaskRunner( | 1264 void WebURLLoaderImpl::setLoadingTaskRunner( |
1264 base::SingleThreadTaskRunner* loading_task_runner) { | 1265 base::SingleThreadTaskRunner* loading_task_runner) { |
1265 context_->SetTaskRunner(loading_task_runner); | 1266 context_->SetTaskRunner(loading_task_runner); |
1266 } | 1267 } |
1267 | 1268 |
1268 } // namespace content | 1269 } // namespace content |
OLD | NEW |