Chromium Code Reviews| Index: components/variations/variations_associated_data.h |
| diff --git a/components/variations/variations_associated_data.h b/components/variations/variations_associated_data.h |
| index 79f31a31e0516904de7f7a262a785d8742cdefdd..11af18d112fb59cacc8718227336c8dd0ad28b1a 100644 |
| --- a/components/variations/variations_associated_data.h |
| +++ b/components/variations/variations_associated_data.h |
| @@ -41,6 +41,10 @@ |
| // // use |id| |
| // } |
| +namespace base { |
| +struct Feature; |
| +} |
| + |
| namespace variations { |
| typedef int VariationID; |
| @@ -123,6 +127,18 @@ bool AssociateVariationParams(const std::string& trial_name, |
| bool GetVariationParams(const std::string& trial_name, |
| std::map<std::string, std::string>* params); |
| +// Retvieves the set of key-value |params| for the variation associated with the |
|
Alexei Svitkine (slow)
2016/05/03 17:04:25
Nit: Retrieves
jwd
2016/05/03 20:12:27
Done.
|
| +// specified |feature|. A feature is associated with at most one variation, |
| +// through the variation's associated field trial, and selected group. See |
| +// base/feature_list.h for more information on features. If the feature is not |
| +// enabled, or if there's no associated variation params, returns false and does |
| +// not modify |params|. Calling this function will result in the associated |
| +// field trial being marked as active if found (i.e. group() will be called on |
| +// it), if it wasn't already. Currently, this information is only available from |
| +// the browser process. Thread safe. |
| +bool GetVariationParamsByFeature(const base::Feature& feature, |
| + std::map<std::string, std::string>* params); |
| + |
| // Retrieves a specific parameter value corresponding to |param_name| for the |
| // variation associated with the specified field trial, based on its selected |
| // group. If the field trial does not exist or the specified parameter does not |
| @@ -133,6 +149,18 @@ bool GetVariationParams(const std::string& trial_name, |
| std::string GetVariationParamValue(const std::string& trial_name, |
| const std::string& param_name); |
| +// Retrieves a specific parameter value corresponding to |param_name| for the |
| +// variation associated with the specified |feature|. A feature is associated |
| +// with at most one variation, through the variation's associated field trial, |
| +// and selected group. See base/feature_list.h for more information on |
| +// features. If the feature is not enabled, or if there's no associated |
| +// variation params, returns false and does not modify |params|. Calling this |
| +// function will result in the associated field trial being marked as active if |
| +// found (i.e. group() will be called on it), if it wasn't already. Currently, |
| +// this information is only available from the browser process. Thread safe. |
| +std::string GetVariationParamValueByFeature(const base::Feature& feature, |
| + const std::string& param_name); |
| + |
| // Expose some functions for testing. |
| namespace testing { |