Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(129)

Side by Side Diff: content/child/web_url_loader_impl.cc

Issue 2484633004: Change Lo-Fi bool to bitmask to support multiple Previews types (Closed)
Patch Set: fix ContentResourceProviderTest Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
1077 SetSecurityStyleAndDetails(url, info, response, report_security_info); 1078 SetSecurityStyleAndDetails(url, info, response, report_security_info);
1078 1079
1079 WebURLResponseExtraDataImpl* extra_data = 1080 WebURLResponseExtraDataImpl* extra_data =
1080 new WebURLResponseExtraDataImpl(info.alpn_negotiated_protocol); 1081 new WebURLResponseExtraDataImpl(info.alpn_negotiated_protocol);
1081 response->setExtraData(extra_data); 1082 response->setExtraData(extra_data);
1082 extra_data->set_was_fetched_via_spdy(info.was_fetched_via_spdy); 1083 extra_data->set_was_fetched_via_spdy(info.was_fetched_via_spdy);
1083 extra_data->set_was_alpn_negotiated(info.was_alpn_negotiated); 1084 extra_data->set_was_alpn_negotiated(info.was_alpn_negotiated);
1084 extra_data->set_was_alternate_protocol_available( 1085 extra_data->set_was_alternate_protocol_available(
1085 info.was_alternate_protocol_available); 1086 info.was_alternate_protocol_available);
1086 extra_data->set_connection_info(info.connection_info); 1087 extra_data->set_connection_info(info.connection_info);
1087 extra_data->set_is_using_lofi(info.is_using_lofi); 1088 extra_data->set_previews_state(info.previews_state);
1088 extra_data->set_effective_connection_type(info.effective_connection_type); 1089 extra_data->set_effective_connection_type(info.effective_connection_type);
1089 1090
1090 // If there's no received headers end time, don't set load timing. This is 1091 // If there's no received headers end time, don't set load timing. This is
1091 // the case for non-HTTP requests, requests that don't go over the wire, and 1092 // the case for non-HTTP requests, requests that don't go over the wire, and
1092 // certain error cases. 1093 // certain error cases.
1093 if (!info.load_timing.receive_headers_end.is_null()) { 1094 if (!info.load_timing.receive_headers_end.is_null()) {
1094 WebURLLoadTiming timing; 1095 WebURLLoadTiming timing;
1095 PopulateURLLoadTiming(info.load_timing, &timing); 1096 PopulateURLLoadTiming(info.load_timing, &timing);
1096 const TimeTicks kNullTicks; 1097 const TimeTicks kNullTicks;
1097 timing.setWorkerStart( 1098 timing.setWorkerStart(
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
1257 int intra_priority_value) { 1258 int intra_priority_value) {
1258 context_->DidChangePriority(new_priority, intra_priority_value); 1259 context_->DidChangePriority(new_priority, intra_priority_value);
1259 } 1260 }
1260 1261
1261 void WebURLLoaderImpl::setLoadingTaskRunner( 1262 void WebURLLoaderImpl::setLoadingTaskRunner(
1262 base::SingleThreadTaskRunner* loading_task_runner) { 1263 base::SingleThreadTaskRunner* loading_task_runner) {
1263 context_->SetTaskRunner(loading_task_runner); 1264 context_->SetTaskRunner(loading_task_runner);
1264 } 1265 }
1265 1266
1266 } // namespace content 1267 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/service_worker/link_header_support_unittest.cc ('k') | content/child/weburlresponse_extradata_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698