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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 2114213002: Fix loading placeholders for Lo-Fi (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/child/web_url_loader_impl.cc ('k') | third_party/WebKit/Source/core/fetch/ImageResource.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 0fe03c647e108e470c63b818949ba1f795a02eed..495de9755a5a50c275a5f72c6f7230da12de0578 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -536,10 +536,11 @@ WebURLRequest CreateURLRequestForNavigation(
}
request.setHTTPMethod(WebString::fromUTF8(common_params.method));
+ request.setLoFiState(
+ static_cast<WebURLRequest::LoFiState>(common_params.lofi_state));
RequestExtraData* extra_data = new RequestExtraData();
extra_data->set_stream_override(std::move(stream_override));
- extra_data->set_lofi_state(common_params.lofi_state);
request.setExtraData(extra_data);
// Set the ui timestamp for this navigation. Currently the timestamp here is
@@ -616,8 +617,9 @@ CommonNavigationParams MakeCommonNavigationParams(
DCHECK(extra_data);
return CommonNavigationParams(
info.urlRequest.url(), referrer, extra_data->transition_type(),
- navigation_type, true, info.replacesCurrentHistoryItem,
- ui_timestamp, report_type, GURL(), GURL(), extra_data->lofi_state(),
+ navigation_type, true, info.replacesCurrentHistoryItem, ui_timestamp,
+ report_type, GURL(), GURL(),
+ static_cast<LoFiState>(info.urlRequest.getLoFiState()),
base::TimeTicks::Now(), info.urlRequest.httpMethod().latin1(),
GetRequestBodyForWebURLRequest(info.urlRequest));
}
@@ -4064,17 +4066,21 @@ void RenderFrameImpl::willSendRequest(
navigation_state->start_params().transferred_request_request_id);
extra_data->set_service_worker_provider_id(provider_id);
extra_data->set_stream_override(std::move(stream_override));
- if (request.getLoFiState() != WebURLRequest::LoFiUnspecified)
- extra_data->set_lofi_state(static_cast<LoFiState>(request.getLoFiState()));
- else if (is_main_frame_ && !navigation_state->request_committed())
- extra_data->set_lofi_state(navigation_state->common_params().lofi_state);
- else
- extra_data->set_lofi_state(is_using_lofi_ ? LOFI_ON : LOFI_OFF);
WebString error;
extra_data->set_initiated_in_secure_context(
frame->document().isSecureContext(error));
request.setExtraData(extra_data);
+ if (request.getLoFiState() == WebURLRequest::LoFiUnspecified) {
+ if (is_main_frame_ && !navigation_state->request_committed()) {
+ request.setLoFiState(static_cast<WebURLRequest::LoFiState>(
+ navigation_state->common_params().lofi_state));
+ } else {
+ request.setLoFiState(
+ is_using_lofi_ ? WebURLRequest::LoFiOn : WebURLRequest::LoFiOff);
+ }
+ }
+
// TODO(creis): Update prefetching to work with out-of-process iframes.
WebFrame* top_frame = frame->top();
if (top_frame && top_frame->isWebLocalFrame()) {
« no previous file with comments | « content/child/web_url_loader_impl.cc ('k') | third_party/WebKit/Source/core/fetch/ImageResource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698