OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENTS_VARIATIONS_VARIATIONS_ASSOCIATED_DATA_H_ | 5 #ifndef COMPONENTS_VARIATIONS_VARIATIONS_ASSOCIATED_DATA_H_ |
6 #define COMPONENTS_VARIATIONS_VARIATIONS_ASSOCIATED_DATA_H_ | 6 #define COMPONENTS_VARIATIONS_VARIATIONS_ASSOCIATED_DATA_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
106 const ActiveGroupId& active_group); | 106 const ActiveGroupId& active_group); |
107 | 107 |
108 // Associates the specified set of key-value |params| with the variation | 108 // Associates the specified set of key-value |params| with the variation |
109 // specified by |trial_name| and |group_name|. Fails and returns false if the | 109 // specified by |trial_name| and |group_name|. Fails and returns false if the |
110 // specified variation already has params associated with it or the field trial | 110 // specified variation already has params associated with it or the field trial |
111 // is already active (group() has been called on it). Thread safe. | 111 // is already active (group() has been called on it). Thread safe. |
112 bool AssociateVariationParams(const std::string& trial_name, | 112 bool AssociateVariationParams(const std::string& trial_name, |
113 const std::string& group_name, | 113 const std::string& group_name, |
114 const std::map<std::string, std::string>& params); | 114 const std::map<std::string, std::string>& params); |
115 | 115 |
116 // TODO: describe string formating | |
117 // TrialName1.GroupName1.Key1/Value1/TrialName2.GroupName2.Key2/Value2/ | |
Alexei Svitkine (slow)
2015/04/22 15:42:37
How about trial.group.key/value/key/value,trial.gr
Alexei Svitkine (slow)
2015/04/24 16:17:26
(Oops, realise above is inconsistent, meant trial.
danduong
2015/04/24 16:22:08
I'm still confused.
do you mean:
trial1.group1:k1
Alexei Svitkine (slow)
2015/04/24 16:31:52
Yes, sorry for not being very clear before.
| |
118 bool AssociateParamsFromString(const std::string&); | |
119 | |
116 // Retrieves the set of key-value |params| for the variation associated with | 120 // Retrieves the set of key-value |params| for the variation associated with |
117 // the specified field trial, based on its selected group. If the field trial | 121 // the specified field trial, based on its selected group. If the field trial |
118 // does not exist or its selected group does not have any parameters associated | 122 // does not exist or its selected group does not have any parameters associated |
119 // with it, returns false and does not modify |params|. Calling this function | 123 // with it, returns false and does not modify |params|. Calling this function |
120 // will result in the field trial being marked as active if found (i.e. group() | 124 // will result in the field trial being marked as active if found (i.e. group() |
121 // will be called on it), if it wasn't already. Currently, this information is | 125 // will be called on it), if it wasn't already. Currently, this information is |
122 // only available from the browser process. Thread safe. | 126 // only available from the browser process. Thread safe. |
123 bool GetVariationParams(const std::string& trial_name, | 127 bool GetVariationParams(const std::string& trial_name, |
124 std::map<std::string, std::string>* params); | 128 std::map<std::string, std::string>* params); |
125 | 129 |
(...skipping 14 matching lines...) Expand all Loading... | |
140 void ClearAllVariationIDs(); | 144 void ClearAllVariationIDs(); |
141 | 145 |
142 // Clears all of the associated params. | 146 // Clears all of the associated params. |
143 void ClearAllVariationParams(); | 147 void ClearAllVariationParams(); |
144 | 148 |
145 } // namespace testing | 149 } // namespace testing |
146 | 150 |
147 } // namespace variations | 151 } // namespace variations |
148 | 152 |
149 #endif // COMPONENTS_VARIATIONS_VARIATIONS_ASSOCIATED_DATA_H_ | 153 #endif // COMPONENTS_VARIATIONS_VARIATIONS_ASSOCIATED_DATA_H_ |
OLD | NEW |