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

Unified Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options.cc

Issue 1310743003: Consistently use LoFi for an entire page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test fixes Created 5 years, 4 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/core/browser/data_reduction_proxy_request_options.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options.cc
index 24be61b0998bdf0d2ccf1d351a23bc011451d626..ee3a1d431c6a120b79e1b322297b46d3f704274f 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options.cc
@@ -8,6 +8,7 @@
#include "base/bind.h"
#include "base/command_line.h"
+#include "base/metrics/field_trial.h"
#include "base/single_thread_task_runner.h"
#include "base/strings/string_split.h"
#include "base/strings/string_tokenizer.h"
@@ -161,13 +162,12 @@ void DataReductionProxyRequestOptions::UpdateVersion() {
void DataReductionProxyRequestOptions::MayRegenerateHeaderBasedOnLoFi(
const net::URLRequest* request) {
DCHECK(thread_checker_.CalledOnValidThread());
+ if (request)
+ DCHECK(!(request->lofi_state() == net::LOFI_DEFAULT));
bengr 2015/08/25 00:00:02 This won't compile on a release build. Do DCHECK(
megjablon 2015/08/25 20:29:46 Done.
- if (!data_reduction_proxy_config_)
- return;
-
- bool lofi_now_enabled =
- !(request && request->load_flags() & net::LOAD_BYPASS_CACHE) &&
- data_reduction_proxy_config_->ShouldUseLoFiHeaderForRequests();
+ bool lofi_now_enabled = request && request->lofi_state() == net::LOFI_ON &&
+ !(base::FieldTrialList::FindFullName(
+ params::GetLoFiFieldTrialName()) == "Control");
// Lo-Fi was not enabled, but now is. Add the header option.
if (lofi_.empty() && lofi_now_enabled) {

Powered by Google App Engine
This is Rietveld 408576698