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

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

Issue 2760063002: Add support to previews/ for Server LoFi and LitePages (Closed)
Patch Set: tbansal comment Created 3 years, 8 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 ac08fb10e9dd25abf5e23f677714624275d659ce..f4ed454b89f5c65c96cfe0c9a7ecdb11024a83c4 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
@@ -59,6 +59,10 @@ const char kPingbackURL[] =
const char kServerExperimentsFieldTrial[] =
"DataReductionProxyServerExperiments";
+// LoFi and LitePage black list versions.
+const char kLoFiBlacklistVersion[] = "lo-fi-blacklist-version";
+const char kLitePageBlacklistVersion[] = "lite-page-blacklist-version";
+
bool IsIncludedInFieldTrial(const std::string& name) {
return base::StartsWith(FieldTrialList::FindFullName(name), kEnabled,
base::CompareCase::SENSITIVE);
@@ -313,6 +317,18 @@ bool ShouldForceEnableDataReductionProxy() {
data_reduction_proxy::switches::kEnableDataReductionProxy);
}
+int ServerLoFiVersion() {
+ return GetFieldTrialParameterAsInteger(
+ data_reduction_proxy::params::GetLoFiFieldTrialName(),
+ kLoFiBlacklistVersion, 0, 0);
+}
+
+int LitePageVersion() {
+ return GetFieldTrialParameterAsInteger(
+ data_reduction_proxy::params::GetLoFiFieldTrialName(),
+ kLitePageBlacklistVersion, 0, 0);
+}
+
int GetFieldTrialParameterAsInteger(const std::string& group,
const std::string& param_name,
int default_value,

Powered by Google App Engine
This is Rietveld 408576698