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

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

Issue 1363673004: [DRP] Consistently use LoFi for an entire page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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.h
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.h b/components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.h
index 141a09b6fb89bd36f55e5f3f3fedd2505fade0f5..c49edbfb79dedd6c1bbd35b99f9454a393923fc7 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.h
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.h
@@ -18,6 +18,7 @@
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options.h"
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_event_storage_delegate.h"
+#include "components/data_reduction_proxy/core/common/data_reduction_proxy_lofi_helper.h"
namespace base {
class Value;
@@ -87,6 +88,10 @@ class DataReductionProxyIOData : public DataReductionProxyEventStorageDelegate {
// Applies a serialized Data Reduction Proxy configuration.
void SetDataReductionProxyConfiguration(const std::string& serialized_config);
+ // Returns true only when Lo-Fi "q=low" header should be added to the Chrome
+ // Proxy header. Should be called only on main frame loads.
+ bool ShouldEnableLoFiMode(net::URLRequest* url_request);
tbansal1 2015/09/28 17:49:02 Is this comment correct? Does this function return
megjablon 2015/09/28 22:43:37 Done.
+
// Sets Lo-Fi mode off in |config_|.
void SetLoFiModeOff();
@@ -162,6 +167,15 @@ class DataReductionProxyIOData : public DataReductionProxyEventStorageDelegate {
debug_ui_service_= ui_service.Pass();
}
+ DataReductionProxyLoFiHelper* lofi_helper() const {
+ return lofi_helper_.get();
+ }
+
+ void set_lofi_helper(
+ scoped_ptr<DataReductionProxyLoFiHelper> lofi_helper) const {
+ lofi_helper_ = lofi_helper.Pass();
+ }
+
private:
friend class TestDataReductionProxyIOData;
FRIEND_TEST_ALL_PREFIXES(DataReductionProxyIODataTest, TestConstruction);
@@ -199,6 +213,9 @@ class DataReductionProxyIOData : public DataReductionProxyEventStorageDelegate {
// interstitials.
mutable scoped_ptr<DataReductionProxyDebugUIService> debug_ui_service_;
+ // Handles the getting and setting of the Lo-Fi UserData on a request.
+ mutable scoped_ptr<DataReductionProxyLoFiHelper> lofi_helper_;
+
// Creates Data Reduction Proxy-related events for logging.
scoped_ptr<DataReductionProxyEventCreator> event_creator_;

Powered by Google App Engine
This is Rietveld 408576698