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

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

Issue 2640023007: Adds PreviewsType version mechanism for clearing blacklist entries. (Closed)
Patch Set: Addressed Ryan recent comments. Created 3 years, 10 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
« no previous file with comments | « no previous file | components/previews/core/previews_experiments.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/previews/core/previews_experiments.h
diff --git a/components/previews/core/previews_experiments.h b/components/previews/core/previews_experiments.h
index ad0bded4a856ee7de386c5c329e28415dd0504a2..0a6f3a6f9a3864cbd5ea96a830600fd63d222f56 100644
--- a/components/previews/core/previews_experiments.h
+++ b/components/previews/core/previews_experiments.h
@@ -5,6 +5,10 @@
#ifndef COMPONENTS_PREVIEWS_CORE_PREVIEWS_EXPERIMENTS_H_
#define COMPONENTS_PREVIEWS_CORE_PREVIEWS_EXPERIMENTS_H_
+#include <memory>
+#include <utility>
+#include <vector>
+
#include "base/time/time.h"
#include "net/nqe/effective_connection_type.h"
@@ -53,9 +57,13 @@ net::EffectiveConnectionType EffectiveConnectionTypeThreshold();
enum class PreviewsType {
NONE = 0,
OFFLINE = 1,
+ // Insert new enum values here. Keep values sequential to allow looping
+ // from NONE+1 to LAST-1.
LAST = 2,
};
+typedef std::vector<std::pair<PreviewsType, int>> PreviewsTypeList;
+
// Returns true if any client-side previews experiment is active.
bool IsIncludedInClientSidePreviewsExperimentsFieldTrial();
@@ -63,6 +71,13 @@ bool IsIncludedInClientSidePreviewsExperimentsFieldTrial();
// prohibitvely slow networks is active.
bool IsPreviewsTypeEnabled(PreviewsType type);
+// Returns the version of preview treatment |type|. Defaults to 0 if not
+// specified in field trial config.
+int GetPreviewsTypeVersion(PreviewsType type);
+
+// Returns the enabled PreviewsTypes with their version.
+std::unique_ptr<PreviewsTypeList> GetEnabledPreviews();
+
// Sets the appropriate state for field trial and variations to imitate the
// offline pages field trial.
bool EnableOfflinePreviewsForTesting();
« no previous file with comments | « no previous file | components/previews/core/previews_experiments.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698