| 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..3eb9567cc3afe41848602b2fc9a2eabdaa00de77 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);
|
|
|
| +// Retrieves the set of key-value |params| 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.
|
| +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 {
|
|
|
|
|