Index: components/variations/variations_associated_data.h |
diff --git a/components/variations/variations_associated_data.h b/components/variations/variations_associated_data.h |
index 0734e8be495a5058b6b009f70a3c4c7f8ea0e524..ad359a485612628782e765139087e6d9666cb729 100644 |
--- a/components/variations/variations_associated_data.h |
+++ b/components/variations/variations_associated_data.h |
@@ -152,13 +152,38 @@ std::string GetVariationParamValue(const std::string& trial_name, |
// 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 the specified parameter does not |
-// exist, returns an empty string.Calling this function will result in the |
+// exist, returns an empty string. 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); |
+// Same as GetVariationParamValueByFeature(). On top of that, it converts the |
+// string value into an int using base::StringToInt() and returns it, if |
+// successful. Otherwise, it returns |default_value|. If the string value is not |
+// empty and the conversion does not succeed, it produces a warning to LOG. |
+int GetVariationParamByFeatureAsInt(const base::Feature& feature, |
+ const std::string& param_name, |
+ int default_value); |
+ |
+// Same as GetVariationParamValueByFeature(). On top of that, it converts the |
+// string value into a double using base::StringToDouble() and returns it, if |
+// successful. Otherwise, it returns |default_value|. If the string value is not |
+// empty and the conversion does not succeed, it produces a warning to LOG. |
+double GetVariationParamByFeatureAsDouble(const base::Feature& feature, |
+ const std::string& param_name, |
+ double default_value); |
+ |
+// Same as GetVariationParamValueByFeature(). On top of that, it converts the |
+// string value into a boolean and returns it, if successful. Otherwise, it |
+// returns |default_value|. The only string representations accepted here are |
+// "true" and "false". If the string value is not empty and the conversion does |
+// not succeed, it produces a warning to LOG. |
+bool GetVariationParamByFeatureAsBool(const base::Feature& feature, |
+ const std::string& param_name, |
+ bool default_value); |
+ |
// Expose some functions for testing. |
namespace testing { |