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

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

Issue 2073233002: Do not trigger Lo-Fi on main frame requests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed comment Created 4 years, 6 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 | « no previous file | components/data_reduction_proxy/content/browser/content_lofi_decider_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/data_reduction_proxy/content/browser/content_lofi_decider.cc
diff --git a/components/data_reduction_proxy/content/browser/content_lofi_decider.cc b/components/data_reduction_proxy/content/browser/content_lofi_decider.cc
index 12b323dc659fbd0e6744089fee207021599081dd..5fe9d03376617915b39f484220960a1298d1fa70 100644
--- a/components/data_reduction_proxy/content/browser/content_lofi_decider.cc
+++ b/components/data_reduction_proxy/content/browser/content_lofi_decider.cc
@@ -67,8 +67,7 @@ bool ContentLoFiDecider::MaybeAddLoFiDirectiveToHeaders(
// If in the preview field trial or the preview flag is enabled, only add the
// "q=preview" directive on main frame requests. Do not add Lo-Fi directives
- // to other requests when previews are enabled. If previews are not enabled,
- // add "q=low".
+ // to other requests when previews are enabled.
if (lofi_preview_via_flag_or_field_trial) {
if (request.load_flags() & net::LOAD_MAIN_FRAME) {
if (params::AreLoFiPreviewsEnabledViaFlags()) {
@@ -77,12 +76,12 @@ bool ContentLoFiDecider::MaybeAddLoFiDirectiveToHeaders(
}
header_value += chrome_proxy_lo_fi_preview_directive();
}
- } else {
+ } else if (!(request.load_flags() & net::LOAD_MAIN_FRAME)) {
+ // If previews are not enabled, add "q=low" for requests that are not main
+ // frame.
header_value += chrome_proxy_lo_fi_directive();
}
- // |header_value| may be empty because the Lo-Fi directive is not added
- // to subrequests when preview mode is enabled.
if (!header_value.empty())
headers->SetHeader(chrome_proxy_header(), header_value);
« no previous file with comments | « no previous file | components/data_reduction_proxy/content/browser/content_lofi_decider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698