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

Unified Diff: components/data_reduction_proxy/core/common/data_reduction_proxy_params.cc

Issue 1363673004: [DRP] Consistently use LoFi for an entire page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: final comments Created 5 years, 2 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/common/data_reduction_proxy_params.cc
diff --git a/components/data_reduction_proxy/core/common/data_reduction_proxy_params.cc b/components/data_reduction_proxy/core/common/data_reduction_proxy_params.cc
index 9595caa03a057d83156a49fcd819bbe0f3eea8b1..9530b2966159b39d01b15b422425acb3dd7192c0 100644
--- a/components/data_reduction_proxy/core/common/data_reduction_proxy_params.cc
+++ b/components/data_reduction_proxy/core/common/data_reduction_proxy_params.cc
@@ -26,6 +26,7 @@ using base::FieldTrialList;
namespace {
const char kEnabled[] = "Enabled";
+const char kControl[] = "Control";
const char kDefaultSpdyOrigin[] = "https://proxy.googlezip.net:443";
const char kDefaultQuicOrigin[] = "quic://proxy.googlezip.net:443";
// A one-off change, until the Data Reduction Proxy configuration service is
@@ -81,6 +82,19 @@ std::string GetLoFiFlagFieldTrialName() {
return kLoFiFlagFieldTrial;
}
+bool IsIncludedInLoFiEnabledFieldTrial() {
+ return FieldTrialList::FindFullName(GetLoFiFieldTrialName()) == kEnabled;
+}
+
+bool IsIncludedInLoFiControlFieldTrial() {
+ return FieldTrialList::FindFullName(GetLoFiFieldTrialName()) == kControl;
+}
+
+bool IsLoFiOnViaFlags() {
+ return IsLoFiAlwaysOnViaFlags() || IsLoFiCellularOnlyViaFlags() ||
+ IsLoFiSlowConnectionsOnlyViaFlags();
+}
+
bool IsLoFiAlwaysOnViaFlags() {
const std::string& lo_fi_value =
base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(

Powered by Google App Engine
This is Rietveld 408576698