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

Unified Diff: content/browser/loader/resource_dispatcher_host_impl.cc

Issue 1310743003: Consistently use LoFi for an entire page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move DRP parts to https://codereview.chromium.org/1363673004/ Created 5 years, 3 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
Index: content/browser/loader/resource_dispatcher_host_impl.cc
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc
index c5c679656570f87722b183927bd5d1313e4cd934..dd3444ec4c3075dd18550f75c16481cc04377b63 100644
--- a/content/browser/loader/resource_dispatcher_host_impl.cc
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -1322,6 +1322,17 @@ void ResourceDispatcherHostImpl::BeginRequest(
}
new_request->SetLoadFlags(load_flags);
+ bool is_lofi;
mmenke 2015/09/29 16:35:57 Maybe is_lofi -> use_lofi / using_lofi / is_using_
megjablon 2015/09/29 21:20:07 Done.
+ if (request_data.lofi_state == LOFI_DEFAULT &&
mmenke 2015/09/29 16:35:57 I think this code makes more sense if LOFI_DEFAULT
megjablon 2015/09/29 21:20:07 Done.
+ (load_flags & net::LOAD_MAIN_FRAME) != 0 && delegate_) {
mmenke 2015/09/29 16:35:57 I don't see why we shouldn't call into the delegat
megjablon 2015/09/29 21:20:07 Done.
+ is_lofi = delegate_->ShouldEnableLoFiMode(new_request.get(),
+ resource_context);
+ } else if (request_data.lofi_state == LOFI_ON) {
+ is_lofi = true;
+ } else {
+ is_lofi = false;
mmenke 2015/09/29 16:35:57 Question: Do favicons also inherit the lofi bit f
megjablon 2015/09/29 21:20:07 The proxy has logic so that icons and button image
+ }
+
// Make extra info and read footer (contains request ID).
ResourceRequestInfoImpl* extra_info = new ResourceRequestInfoImpl(
process_type, child_id, route_id,
@@ -1346,7 +1357,8 @@ void ResourceDispatcherHostImpl::BeginRequest(
request_data.visiblity_state,
resource_context, filter_->GetWeakPtr(),
report_raw_headers,
- !is_sync_load);
+ !is_sync_load,
+ is_lofi);
// Request takes ownership.
extra_info->AssociateWithRequest(new_request.get());
@@ -1622,7 +1634,8 @@ ResourceRequestInfoImpl* ResourceDispatcherHostImpl::CreateRequestInfo(
context,
base::WeakPtr<ResourceMessageFilter>(), // filter
false, // report_raw_headers
- true); // is_async
+ true, // is_async
+ false); // is_lofi
}
void ResourceDispatcherHostImpl::OnRenderViewHostCreated(int child_id,
@@ -2033,6 +2046,16 @@ void ResourceDispatcherHostImpl::BeginNavigationRequest(
request_id_--;
+ bool is_lofi;
+ if (info.common_params.lofi_state == LOFI_DEFAULT && delegate_) {
+ is_lofi = delegate_->ShouldEnableLoFiMode(new_request.get(),
+ resource_context);
+ } else if (info.common_params.lofi_state == LOFI_ON) {
+ is_lofi = true;
+ } else {
+ is_lofi = false;
+ }
+
// Make extra info and read footer (contains request ID).
//
// TODO(davidben): Associate the request with the FrameTreeNode and/or tab so
@@ -2068,7 +2091,8 @@ void ResourceDispatcherHostImpl::BeginNavigationRequest(
resource_context,
base::WeakPtr<ResourceMessageFilter>(), // filter
false, // request_data.report_raw_headers
- true);
+ true,
+ is_lofi);
// Request takes ownership.
extra_info->AssociateWithRequest(new_request.get());

Powered by Google App Engine
This is Rietveld 408576698