Chromium Code Reviews| 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) { |