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