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

Unified Diff: components/data_reduction_proxy/core/common/lofi_decider.h

Issue 1463583003: Move adding Lo-Fi directives from DRPRequestOptions to ContentLoFiDecider (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressing tbansal comments Created 5 years, 1 month 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/common/lofi_decider.h
diff --git a/components/data_reduction_proxy/core/common/lofi_decider.h b/components/data_reduction_proxy/core/common/lofi_decider.h
index dfe484c6681a726ec5fa5e629013cbbc71fc7934..727b87b59927fe34b9e8bf159cdd1a54dd2aff48 100644
--- a/components/data_reduction_proxy/core/common/lofi_decider.h
+++ b/components/data_reduction_proxy/core/common/lofi_decider.h
@@ -8,6 +8,10 @@
#include "base/macros.h"
#include "net/url_request/url_request.h"
+namespace net {
+class HttpRequestHeaders;
+}
+
namespace data_reduction_proxy {
// Interface to determine if a request should be made for a low fidelity version
@@ -17,9 +21,16 @@ class LoFiDecider {
virtual ~LoFiDecider() {}
// Returns true when Lo-Fi mode is on for the given |request|. This means the
- // Lo-Fi header should be added to the given request, unless the user is in
- // in the Lo-Fi control group.
+ // Lo-Fi header should be added to the given request.
virtual bool IsUsingLoFiMode(const net::URLRequest& request) const = 0;
+
+ // Returns true when Lo-Fi mode is on for the given |request|. If the
+ // |request| is using Lo-Fi mode, adds the "q=low" directive to the |headers|.
+ // If the user is in the experiment control group and Lo-Fi is on, adds the
+ // experiment directive "exp=lofi_active_control".
+ virtual bool MaybeAddLoFiDirectiveToHeaders(
+ const net::URLRequest& request,
+ net::HttpRequestHeaders* headers) const = 0;
};
} // namespace data_reduction_proxy

Powered by Google App Engine
This is Rietveld 408576698