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

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

Issue 2541353006: Making offline previews freshness configurable (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « components/previews/core/previews_experiments.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/previews/core/previews_experiments.cc
diff --git a/components/previews/core/previews_experiments.cc b/components/previews/core/previews_experiments.cc
index 97ab3e9a0783b0317bd5adf3c015f5acdd9c0685..fc7922cca8a83bf8b79c8419372e9c5761183a63 100644
--- a/components/previews/core/previews_experiments.cc
+++ b/components/previews/core/previews_experiments.cc
@@ -59,6 +59,11 @@ const char kHostIndifferentBlackListDurationInDays[] =
const char kSingleOptOutDurationInSeconds[] =
"single_opt_out_duration_in_seconds";
+// The amount of time that an offline page is considered fresh enough to be
+// shown as a preview.
+const char kOfflinePreviewFreshnessDurationInDays[] =
+ "offline_preview_freshness_duration_in_days";
+
// The string that corresponds to enabled for the variation param experiments.
const char kExperimentEnabled[] = "true";
@@ -153,6 +158,15 @@ base::TimeDelta SingleOptOutDuration() {
return base::TimeDelta::FromSeconds(duration);
}
+base::TimeDelta OfflinePreviewFreshnessDuration() {
+ std::string param_value = ParamValue(kOfflinePreviewFreshnessDurationInDays);
+ int duration;
+ if (!base::StringToInt(param_value, &duration)) {
+ return base::TimeDelta::FromDays(7);
+ }
+ return base::TimeDelta::FromDays(duration);
+}
+
} // namespace params
bool IsIncludedInClientSidePreviewsExperimentsFieldTrial() {
« no previous file with comments | « components/previews/core/previews_experiments.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698