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

Unified Diff: components/data_reduction_proxy/content/browser/content_data_reduction_proxy_lofi_helper.cc

Issue 1310743003: Consistently use LoFi for an entire page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mmenke comments 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: components/data_reduction_proxy/content/browser/content_data_reduction_proxy_lofi_helper.cc
diff --git a/components/data_reduction_proxy/content/browser/content_data_reduction_proxy_lofi_helper.cc b/components/data_reduction_proxy/content/browser/content_data_reduction_proxy_lofi_helper.cc
index 1afd5f9ddf1ee9b8cc31899c9ad15d9d09a3d85f..9458d828c406315d1d436d9fb7d9691185fb1a39 100644
--- a/components/data_reduction_proxy/content/browser/content_data_reduction_proxy_lofi_helper.cc
+++ b/components/data_reduction_proxy/content/browser/content_data_reduction_proxy_lofi_helper.cc
@@ -16,12 +16,16 @@ ContentDataReductionProxyLoFiHelper::~ContentDataReductionProxyLoFiHelper() {}
bool ContentDataReductionProxyLoFiHelper::ShouldUseLoFi(
const net::URLRequest* request) const {
- // TODO: will be check of IsLoFi ResourceRequestInfo &&
- // (params::IsLoFiOnViaFlags() ||
- // params::IsIncludedInLoFiEnabledFieldTrial())
- // The Lo-Fi directive should not be added for users in the Lo-Fi field
- // trial "Control" group. Check that the user is in a group that should
- // get "q=low".
+ const content::ResourceRequestInfo* request_info =
+ content::ResourceRequestInfo::ForRequest(request);
+ if (request_info) {
+ // The Lo-Fi directive should not be added for users in the Lo-Fi field
+ // trial "Control" group unless he or she turns on Lo-Fi through a flag.
+ // Check that the user is in a group that should get "q=low".
+ return request_info->IsUsingLoFi() &&
+ (params::IsLoFiOnViaFlags() ||
+ params::IsIncludedInLoFiEnabledFieldTrial());
+ }
return false;
}

Powered by Google App Engine
This is Rietveld 408576698