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

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

Issue 1363673004: [DRP] Consistently use LoFi for an entire page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressing tbansal 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/core/browser/data_reduction_proxy_io_data.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.cc
index 9fb4b00a99a573096e1060b1dfeec48ea29121a3..025d60cac407869b45209c5d575c18d27bea4a48 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.cc
@@ -25,6 +25,7 @@
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_params.h"
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_pref_names.h"
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_switches.h"
+#include "net/base/load_flags.h"
#include "net/log/net_log.h"
#include "net/url_request/http_user_agent_settings.h"
#include "net/url_request/static_http_user_agent_settings.h"
@@ -262,6 +263,13 @@ void DataReductionProxyIOData::SetDataReductionProxyConfiguration(
config_client_->ApplySerializedConfig(serialized_config);
}
+bool DataReductionProxyIOData::ShouldEnableLoFiMode(net::URLRequest* request) {
+ DCHECK(request && (request->load_flags() & net::LOAD_MAIN_FRAME) != 0);
+ if (!config_)
+ return false;
+ return config_->ShouldEnableLoFiMode(request);
+}
+
void DataReductionProxyIOData::SetLoFiModeOff() {
config_->SetLoFiModeOff();
}

Powered by Google App Engine
This is Rietveld 408576698