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 9530b2966159b39d01b15b422425acb3dd7192c0..d84bf983ba13a1b05b851e33f5fe7d65d5fc61f3 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 |
@@ -27,6 +27,7 @@ namespace { |
const char kEnabled[] = "Enabled"; |
const char kControl[] = "Control"; |
+const char kPreview[] = "Enabled_Preview"; |
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 |
@@ -83,13 +84,18 @@ std::string GetLoFiFlagFieldTrialName() { |
} |
bool IsIncludedInLoFiEnabledFieldTrial() { |
- return FieldTrialList::FindFullName(GetLoFiFieldTrialName()) == kEnabled; |
+ return FieldTrialList::FindFullName(GetLoFiFieldTrialName()) |
Lei Zhang
2015/11/24 02:08:35
Is the following more readable?
std::string name
megjablon
2015/11/24 18:41:58
Yes, I like this much better. Thanks!
|
+ .compare(0, strlen(kEnabled), kEnabled) == 0; |
} |
bool IsIncludedInLoFiControlFieldTrial() { |
return FieldTrialList::FindFullName(GetLoFiFieldTrialName()) == kControl; |
} |
+bool IsIncludedInLoFiPreviewFieldTrial() { |
+ return FieldTrialList::FindFullName(GetLoFiFieldTrialName()) == kPreview; |
+} |
+ |
bool IsLoFiOnViaFlags() { |
return IsLoFiAlwaysOnViaFlags() || IsLoFiCellularOnlyViaFlags() || |
IsLoFiSlowConnectionsOnlyViaFlags(); |
@@ -127,6 +133,11 @@ bool IsLoFiDisabledViaFlags() { |
data_reduction_proxy::switches::kDataReductionProxyLoFiValueDisabled; |
} |
+bool AreLoFiPreviewsEnabledViaFlags() { |
+ return base::CommandLine::ForCurrentProcess()->HasSwitch( |
+ data_reduction_proxy::switches::kEnableDataReductionProxyLoFiPreview); |
+} |
+ |
bool WarnIfNoDataReductionProxy() { |
if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
data_reduction_proxy::switches:: |