Chromium Code Reviews| Index: base/feature_list.h |
| diff --git a/base/feature_list.h b/base/feature_list.h |
| index 44aeb4b88b7e531eb3b402724578789e471dc1ad..2a47427fb268e6d63cba9005fb31727ed326aa2f 100644 |
| --- a/base/feature_list.h |
| +++ b/base/feature_list.h |
| @@ -141,6 +141,10 @@ class BASE_EXPORT FeatureList { |
| // struct, which is checked in builds with DCHECKs enabled. |
| static bool IsEnabled(const Feature& feature); |
| + // Returns the field trial associated with the given |feature|. Must only be |
| + // called after the singleton instance has been registered via SetInstance(). |
| + static FieldTrial* GetFieldTrial(const Feature& feature); |
|
Alexei Svitkine (slow)
2016/05/03 17:04:25
Can you also add a unit test for this API?
jwd
2016/05/03 20:12:27
Done.
|
| + |
| // Splits a comma-separated string containing feature names into a vector. |
| static std::vector<std::string> SplitFeatureListString( |
| const std::string& input); |
| @@ -200,6 +204,12 @@ class BASE_EXPORT FeatureList { |
| // Requires the FeatureList to have already been fully initialized. |
| bool IsFeatureEnabled(const Feature& feature); |
| + // Returns the field trial associated with the given |feature|. This is |
| + // invoked by the public FeatureList::GetFieldTrial() static function on the |
| + // global singleton. Requires the FeatureList to have already been fully |
| + // initialized. |
| + base::FieldTrial* GetAssociatedFieldTrial(const Feature& feature); |
| + |
| // For each feature name in comma-separated list of strings |feature_list|, |
| // registers an override with the specified |overridden_state|. Also, will |
| // associate an optional named field trial if the entry is of the format |