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

Unified Diff: components/previews/core/previews_experiments.cc

Issue 2760063002: Add support to previews/ for Server LoFi and LitePages (Closed)
Patch Set: Coverging LoFi types Created 3 years, 7 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/previews/core/previews_experiments.cc
diff --git a/components/previews/core/previews_experiments.cc b/components/previews/core/previews_experiments.cc
index e8d738aa60a6b5fb0c735ab700faf301582065a2..13bc5033913c669e487bbc1315588bf03a7230ce 100644
--- a/components/previews/core/previews_experiments.cc
+++ b/components/previews/core/previews_experiments.cc
@@ -4,8 +4,6 @@
#include "components/previews/core/previews_experiments.h"
-#include <string>
-
#include "base/logging.h"
#include "base/metrics/field_trial.h"
#include "base/metrics/field_trial_params.h"
@@ -128,7 +126,7 @@ base::TimeDelta OfflinePreviewFreshnessDuration() {
"offline_preview_freshness_duration_in_days", 7));
}
-net::EffectiveConnectionType EffectiveConnectionTypeThresholdForOffline() {
+net::EffectiveConnectionType EffectiveConnectionTypeThreshold() {
return GetParamValueAsECT(kClientSidePreviewsFieldTrial,
kEffectiveConnectionTypeThreshold,
net::EFFECTIVE_CONNECTION_TYPE_SLOW_2G);
@@ -152,11 +150,11 @@ bool IsClientLoFiEnabled() {
base::CompareCase::SENSITIVE);
}
-int ClientLoFiVersion() {
+int LoFiVersion() {
return GetParamValueAsInt(kClientLoFiExperimentName, kVersion, 0);
}
-net::EffectiveConnectionType EffectiveConnectionTypeThresholdForClientLoFi() {
+net::EffectiveConnectionType EffectiveConnectionTypeThresholdForLoFi() {
return GetParamValueAsECT(kClientLoFiExperimentName,
kEffectiveConnectionTypeThreshold,
net::EFFECTIVE_CONNECTION_TYPE_2G);
@@ -173,4 +171,20 @@ bool IsIncludedInClientSidePreviewsExperimentsFieldTrial() {
kEnabled, base::CompareCase::SENSITIVE);
}
+std::string GetStringNameForType(PreviewsType type) {
+ switch (type) {
+ case PreviewsType::OFFLINE:
+ return "Offline";
+ case PreviewsType::LOFI:
+ return "LoFi";
+ case PreviewsType::LITE_PAGE:
+ return "LitePage";
+ case PreviewsType::NONE:
+ case PreviewsType::LAST:
+ break;
+ }
+ NOTREACHED();
+ return std::string();
+}
+
} // namespace previews

Powered by Google App Engine
This is Rietveld 408576698