OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // FieldTrial is a class for handling details of statistical experiments | 5 // FieldTrial is a class for handling details of statistical experiments |
6 // performed by actual users in the field (i.e., in a shipped or beta product). | 6 // performed by actual users in the field (i.e., in a shipped or beta product). |
7 // All code is called exclusively on the UI thread currently. | 7 // All code is called exclusively on the UI thread currently. |
8 // | 8 // |
9 // The simplest example is an experiment to see whether one of two options | 9 // The simplest example is an experiment to see whether one of two options |
10 // produces "better" results across our user population. In that scenario, UMA | 10 // produces "better" results across our user population. In that scenario, UMA |
11 // data is uploaded to aggregate the test results, and this FieldTrial class | 11 // data is uploaded to aggregate the test results, and this FieldTrial class |
12 // manages the state of each such experiment (state == which option was | 12 // manages the state of each such experiment (state == which option was |
13 // pseudo-randomly selected). | 13 // pseudo-randomly selected). |
14 // | 14 // |
15 // States are typically generated randomly, either based on a one time | 15 // States are typically generated randomly, either based on a one time |
16 // randomization (generated randomly once, and then persistently reused in the | 16 // randomization (which will yield the same results, in terms of selecting |
17 // client during each future run of the program), or by a startup randomization | 17 // the client for a field trial or not, for every run of the program on a |
18 // (generated each time the application starts up, but held constant during the | 18 // given machine), or by a startup randomization (generated each time the |
19 // duration of the process), or by continuous randomization across a run (where | 19 // application starts up, but held constant during the duration of the |
20 // the state can be recalculated again and again, many times during a process). | 20 // process), or by continuous randomization across a run (where the state |
21 // Only startup randomization is implemented thus far. | 21 // can be recalculated again and again, many times during a process). |
| 22 // Continuous randomization is not yet implemented. |
22 | 23 |
23 //------------------------------------------------------------------------------ | 24 //------------------------------------------------------------------------------ |
24 // Example: Suppose we have an experiment involving memory, such as determining | 25 // Example: Suppose we have an experiment involving memory, such as determining |
25 // the impact of some pruning algorithm. | 26 // the impact of some pruning algorithm. |
26 // We assume that we already have a histogram of memory usage, such as: | 27 // We assume that we already have a histogram of memory usage, such as: |
27 | 28 |
28 // HISTOGRAM_COUNTS("Memory.RendererTotal", count); | 29 // HISTOGRAM_COUNTS("Memory.RendererTotal", count); |
29 | 30 |
30 // Somewhere in main thread initialization code, we'd probably define an | 31 // Somewhere in main thread initialization code, we'd probably define an |
31 // instance of a FieldTrial, with code such as: | 32 // instance of a FieldTrial, with code such as: |
(...skipping 13 matching lines...) Expand all Loading... |
45 // if (trial->group() == kHighMemGroup) | 46 // if (trial->group() == kHighMemGroup) |
46 // SetPruningAlgorithm(kType1); // Sample setting of browser state. | 47 // SetPruningAlgorithm(kType1); // Sample setting of browser state. |
47 // else if (trial->group() == kLowMemGroup) | 48 // else if (trial->group() == kLowMemGroup) |
48 // SetPruningAlgorithm(kType2); // Sample alternate setting. | 49 // SetPruningAlgorithm(kType2); // Sample alternate setting. |
49 | 50 |
50 // We then, in addition to our original histogram, output histograms which have | 51 // We then, in addition to our original histogram, output histograms which have |
51 // slightly different names depending on what group the trial instance happened | 52 // slightly different names depending on what group the trial instance happened |
52 // to randomly be assigned: | 53 // to randomly be assigned: |
53 | 54 |
54 // HISTOGRAM_COUNTS("Memory.RendererTotal", count); // The original histogram. | 55 // HISTOGRAM_COUNTS("Memory.RendererTotal", count); // The original histogram. |
55 // static bool use_memoryexperiment_histogram( | 56 // static const bool memory_renderer_total_trial_exists = |
56 // base::FieldTrialList::Find("MemoryExperiment") && | 57 // FieldTrialList::TrialExists("Memory.RendererTotal"); |
57 // !base::FieldTrialList::Find("MemoryExperiment")->group_name().empty()); | 58 // if (memory_renderer_total_trial_exists) { |
58 // if (use_memoryexperiment_histogram) { | |
59 // HISTOGRAM_COUNTS(FieldTrial::MakeName("Memory.RendererTotal", | 59 // HISTOGRAM_COUNTS(FieldTrial::MakeName("Memory.RendererTotal", |
60 // "MemoryExperiment"), count); | 60 // "MemoryExperiment"), count); |
61 // } | 61 // } |
62 | 62 |
63 // The above code will create four distinct histograms, with each run of the | 63 // The above code will create four distinct histograms, with each run of the |
64 // application being assigned to of of the three groups, and for each group, the | 64 // application being assigned to of of the three groups, and for each group, the |
65 // correspondingly named histogram will be populated: | 65 // correspondingly named histogram will be populated: |
66 | 66 |
67 // Memory.RendererTotal // 100% of users still fill this histogram. | 67 // Memory.RendererTotal // 100% of users still fill this histogram. |
68 // Memory.RendererTotal_HighMem // 2% of users will fill this histogram. | 68 // Memory.RendererTotal_HighMem // 2% of users will fill this histogram. |
(...skipping 27 matching lines...) Expand all Loading... |
96 // A return value to indicate that a given instance has not yet had a group | 96 // A return value to indicate that a given instance has not yet had a group |
97 // assignment (and hence is not yet participating in the trial). | 97 // assignment (and hence is not yet participating in the trial). |
98 static const int kNotFinalized; | 98 static const int kNotFinalized; |
99 | 99 |
100 // This is the group number of the 'default' group. This provides an easy way | 100 // This is the group number of the 'default' group. This provides an easy way |
101 // to assign all the remaining probability to a group ('default'). | 101 // to assign all the remaining probability to a group ('default'). |
102 static const int kDefaultGroupNumber; | 102 static const int kDefaultGroupNumber; |
103 | 103 |
104 // The name is used to register the instance with the FieldTrialList class, | 104 // The name is used to register the instance with the FieldTrialList class, |
105 // and can be used to find the trial (only one trial can be present for each | 105 // and can be used to find the trial (only one trial can be present for each |
106 // name). | 106 // name). |name| and |default_group_name| may not be empty. |
| 107 // |
107 // Group probabilities that are later supplied must sum to less than or equal | 108 // Group probabilities that are later supplied must sum to less than or equal |
108 // to the total_probability. Arguments year, month and day_of_month specify | 109 // to the total_probability. Arguments year, month and day_of_month specify |
109 // the expiration time. If the build time is after the expiration time then | 110 // the expiration time. If the build time is after the expiration time then |
110 // the field trial reverts to the 'default' group. | 111 // the field trial reverts to the 'default' group. |
| 112 // |
| 113 // Using this constructor creates a startup-randomized FieldTrial. If you |
| 114 // want a one-time randomized trial, call UseOneTimeRandomization() right |
| 115 // after construction. |
111 FieldTrial(const std::string& name, Probability total_probability, | 116 FieldTrial(const std::string& name, Probability total_probability, |
112 const std::string& default_group_name, const int year, | 117 const std::string& default_group_name, const int year, |
113 const int month, const int day_of_month); | 118 const int month, const int day_of_month); |
114 | 119 |
| 120 // Changes the field trial to use one-time randomization, i.e. produce the |
| 121 // same result for the current trial on every run of this client. Must be |
| 122 // called right after construction. |
| 123 // |
| 124 // Before using this method, |FieldTrialList::EnableOneTimeRandomization()| |
| 125 // must be called exactly once. |
| 126 void UseOneTimeRandomization(); |
| 127 |
| 128 // Disables this trial, meaning it always determines the default group |
| 129 // has been selected. May be called immediately after construction, or |
| 130 // at any time after initialization (should not be interleaved with |
| 131 // AppendGroup calls). Once disabled, there is no way to re-enable a |
| 132 // trial. |
| 133 void Disable(); |
| 134 |
115 // Establish the name and probability of the next group in this trial. | 135 // Establish the name and probability of the next group in this trial. |
116 // Sometimes, based on construction randomization, this call may cause the | 136 // Sometimes, based on construction randomization, this call may cause the |
117 // provided group to be *THE* group selected for use in this instance. | 137 // provided group to be *THE* group selected for use in this instance. |
118 // The return value is the group number of the new group. | 138 // The return value is the group number of the new group. |
119 int AppendGroup(const std::string& name, Probability group_probability); | 139 int AppendGroup(const std::string& name, Probability group_probability); |
120 | 140 |
121 // Return the name of the FieldTrial (excluding the group name). | 141 // Return the name of the FieldTrial (excluding the group name). |
122 std::string name() const { return name_; } | 142 std::string name() const { return name_; } |
123 | 143 |
124 // Return the randomly selected group number that was assigned. | 144 // Return the randomly selected group number that was assigned. |
125 // Return kDefaultGroupNumber if the instance is in the 'default' group. | 145 // Return kDefaultGroupNumber if the instance is in the 'default' group. |
126 // Note that this will force an instance to participate, and make it illegal | 146 // Note that this will force an instance to participate, and make it illegal |
127 // to attempt to probabalistically add any other groups to the trial. | 147 // to attempt to probabilistically add any other groups to the trial. |
128 int group(); | 148 int group(); |
129 | 149 |
130 // If the field trial is not in an experiment, this returns the empty string. | 150 // If the group's name is empty, a string version containing the group |
131 // if the group's name is empty, a name of "_" concatenated with the group | |
132 // number is used as the group name. | 151 // number is used as the group name. |
133 std::string group_name(); | 152 std::string group_name(); |
134 | 153 |
135 // Return the default group name of the FieldTrial. | 154 // Return the default group name of the FieldTrial. |
136 std::string default_group_name() const { return default_group_name_; } | 155 std::string default_group_name() const { return default_group_name_; } |
137 | 156 |
138 // Helper function for the most common use: as an argument to specifiy the | 157 // Helper function for the most common use: as an argument to specify the |
139 // name of a HISTOGRAM. Use the original histogram name as the name_prefix. | 158 // name of a HISTOGRAM. Use the original histogram name as the name_prefix. |
140 static std::string MakeName(const std::string& name_prefix, | 159 static std::string MakeName(const std::string& name_prefix, |
141 const std::string& trial_name); | 160 const std::string& trial_name); |
142 | 161 |
143 // Enable benchmarking sets field trials to a common setting. | 162 // Enable benchmarking sets field trials to a common setting. |
144 static void EnableBenchmarking(); | 163 static void EnableBenchmarking(); |
145 | 164 |
146 private: | 165 private: |
147 // Allow tests to access our innards for testing purposes. | 166 // Allow tests to access our innards for testing purposes. |
148 FRIEND_TEST(FieldTrialTest, Registration); | 167 FRIEND_TEST(FieldTrialTest, Registration); |
149 FRIEND_TEST(FieldTrialTest, AbsoluteProbabilities); | 168 FRIEND_TEST(FieldTrialTest, AbsoluteProbabilities); |
150 FRIEND_TEST(FieldTrialTest, RemainingProbability); | 169 FRIEND_TEST(FieldTrialTest, RemainingProbability); |
151 FRIEND_TEST(FieldTrialTest, FiftyFiftyProbability); | 170 FRIEND_TEST(FieldTrialTest, FiftyFiftyProbability); |
152 FRIEND_TEST(FieldTrialTest, MiddleProbabilities); | 171 FRIEND_TEST(FieldTrialTest, MiddleProbabilities); |
153 FRIEND_TEST(FieldTrialTest, OneWinner); | 172 FRIEND_TEST(FieldTrialTest, OneWinner); |
154 FRIEND_TEST(FieldTrialTest, DisableProbability); | 173 FRIEND_TEST(FieldTrialTest, DisableProbability); |
155 FRIEND_TEST(FieldTrialTest, Save); | 174 FRIEND_TEST(FieldTrialTest, Save); |
156 FRIEND_TEST(FieldTrialTest, DuplicateRestore); | 175 FRIEND_TEST(FieldTrialTest, DuplicateRestore); |
157 FRIEND_TEST(FieldTrialTest, MakeName); | 176 FRIEND_TEST(FieldTrialTest, MakeName); |
| 177 FRIEND_TEST(FieldTrialTest, HashClientId); |
| 178 FRIEND_TEST(FieldTrialTest, HashClientIdIsUniform); |
| 179 FRIEND_TEST(FieldTrialTest, UseOneTimeRandomization); |
158 | 180 |
159 friend class base::FieldTrialList; | 181 friend class base::FieldTrialList; |
160 | 182 |
161 friend class RefCounted<FieldTrial>; | 183 friend class RefCounted<FieldTrial>; |
162 | 184 |
163 virtual ~FieldTrial(); | 185 virtual ~FieldTrial(); |
164 | 186 |
165 // Returns the group_name. A winner need not have been chosen. | 187 // Returns the group_name. A winner need not have been chosen. |
166 std::string group_name_internal() const { return group_name_; } | 188 std::string group_name_internal() const { return group_name_; } |
167 | 189 |
168 // Get build time. | 190 // Get build time. |
169 static Time GetBuildTime(); | 191 static Time GetBuildTime(); |
170 | 192 |
| 193 // Calculates a uniformly-distributed double between [0.0, 1.0) given |
| 194 // a |client_id| and a |trial_name| (the latter is used as salt to avoid |
| 195 // separate one-time randomized trials from all having the same results). |
| 196 static double HashClientId(const std::string& client_id, |
| 197 const std::string& trial_name); |
| 198 |
171 // The name of the field trial, as can be found via the FieldTrialList. | 199 // The name of the field trial, as can be found via the FieldTrialList. |
172 // This is empty of the trial is not in the experiment. | |
173 const std::string name_; | 200 const std::string name_; |
174 | 201 |
175 // The maximum sum of all probabilities supplied, which corresponds to 100%. | 202 // The maximum sum of all probabilities supplied, which corresponds to 100%. |
176 // This is the scaling factor used to adjust supplied probabilities. | 203 // This is the scaling factor used to adjust supplied probabilities. |
177 const Probability divisor_; | 204 const Probability divisor_; |
178 | 205 |
179 // The name of the default group. | 206 // The name of the default group. |
180 const std::string default_group_name_; | 207 const std::string default_group_name_; |
181 | 208 |
182 // The randomly selected probability that is used to select a group (or have | 209 // The randomly selected probability that is used to select a group (or have |
183 // the instance not participate). It is the product of divisor_ and a random | 210 // the instance not participate). It is the product of divisor_ and a random |
184 // number between [0, 1). | 211 // number between [0, 1). |
185 const Probability random_; | 212 Probability random_; |
186 | 213 |
187 // Sum of the probabilities of all appended groups. | 214 // Sum of the probabilities of all appended groups. |
188 Probability accumulated_group_probability_; | 215 Probability accumulated_group_probability_; |
189 | 216 |
190 int next_group_number_; | 217 int next_group_number_; |
191 | 218 |
192 // The pseudo-randomly assigned group number. | 219 // The pseudo-randomly assigned group number. |
193 // This is kNotFinalized if no group has been assigned. | 220 // This is kNotFinalized if no group has been assigned. |
194 int group_; | 221 int group_; |
195 | 222 |
196 // A textual name for the randomly selected group. If this Trial is not a | 223 // A textual name for the randomly selected group. Valid after |group()| |
197 // member of an group, this string is empty. | 224 // has been called. |
198 std::string group_name_; | 225 std::string group_name_; |
199 | 226 |
200 // When disable_field_trial_ is true, field trial reverts to the 'default' | 227 // When enable_field_trial_ is false, field trial reverts to the 'default' |
201 // group. | 228 // group. |
202 bool disable_field_trial_; | 229 bool enable_field_trial_; |
203 | 230 |
204 // When benchmarking is enabled, field trials all revert to the 'default' | 231 // When benchmarking is enabled, field trials all revert to the 'default' |
205 // group. | 232 // group. |
206 static bool enable_benchmarking_; | 233 static bool enable_benchmarking_; |
207 | 234 |
208 DISALLOW_COPY_AND_ASSIGN(FieldTrial); | 235 DISALLOW_COPY_AND_ASSIGN(FieldTrial); |
209 }; | 236 }; |
210 | 237 |
211 //------------------------------------------------------------------------------ | 238 //------------------------------------------------------------------------------ |
212 // Class with a list of all active field trials. A trial is active if it has | 239 // Class with a list of all active field trials. A trial is active if it has |
(...skipping 14 matching lines...) Expand all Loading... |
227 public: | 254 public: |
228 // Notify observers when FieldTrials's group is selected. | 255 // Notify observers when FieldTrials's group is selected. |
229 virtual void OnFieldTrialGroupFinalized(const std::string& trial_name, | 256 virtual void OnFieldTrialGroupFinalized(const std::string& trial_name, |
230 const std::string& group_name) = 0; | 257 const std::string& group_name) = 0; |
231 | 258 |
232 protected: | 259 protected: |
233 virtual ~Observer() {} | 260 virtual ~Observer() {} |
234 }; | 261 }; |
235 | 262 |
236 // This singleton holds the global list of registered FieldTrials. | 263 // This singleton holds the global list of registered FieldTrials. |
237 FieldTrialList(); | 264 // |
| 265 // |client_id| should be an opaque, diverse ID for this client that does not |
| 266 // change between sessions, to enable one-time randomized trials. The empty |
| 267 // string may be provided, in which case one-time randomized trials will |
| 268 // not be available. |
| 269 explicit FieldTrialList(const std::string& client_id); |
238 // Destructor Release()'s references to all registered FieldTrial instances. | 270 // Destructor Release()'s references to all registered FieldTrial instances. |
239 ~FieldTrialList(); | 271 ~FieldTrialList(); |
240 | 272 |
241 // Register() stores a pointer to the given trial in a global map. | 273 // Register() stores a pointer to the given trial in a global map. |
242 // This method also AddRef's the indicated trial. | 274 // This method also AddRef's the indicated trial. |
243 static void Register(FieldTrial* trial); | 275 static void Register(FieldTrial* trial); |
244 | 276 |
245 // The Find() method can be used to test to see if a named Trial was already | 277 // The Find() method can be used to test to see if a named Trial was already |
246 // registered, or to retrieve a pointer to it from the global map. | 278 // registered, or to retrieve a pointer to it from the global map. |
247 static FieldTrial* Find(const std::string& name); | 279 static FieldTrial* Find(const std::string& name); |
248 | 280 |
| 281 // Returns the group number chosen for the named trial, or |
| 282 // FieldTrial::kNotFinalized if the trial does not exist. |
249 static int FindValue(const std::string& name); | 283 static int FindValue(const std::string& name); |
250 | 284 |
| 285 // Returns the group name chosen for the named trial, or the |
| 286 // empty string if the trial does not exist. |
251 static std::string FindFullName(const std::string& name); | 287 static std::string FindFullName(const std::string& name); |
252 | 288 |
253 // Create a persistent representation of all FieldTrial instances for | 289 // Returns true if the named trial has been registered. |
254 // resurrection in another process. This allows randomization to be done in | 290 static bool TrialExists(const std::string& name); |
255 // one process, and secondary processes can by synchronized on the result. | 291 |
256 // The resulting string contains only the names, the trial name, and a "/" | 292 // Create a persistent representation of all FieldTrial instances and the |
257 // separator. | 293 // |client_id()| state for resurrection in another process. This allows |
| 294 // randomization to be done in one process, and secondary processes can by |
| 295 // synchronized on the result. The resulting string contains the |
| 296 // |client_id()|, the names, the trial name, and a "/" separator. |
258 static void StatesToString(std::string* output); | 297 static void StatesToString(std::string* output); |
259 | 298 |
260 // Use a previously generated state string (re: StatesToString()) augment the | 299 // Use a previously generated state string (re: StatesToString()) augment the |
261 // current list of field tests to include the supplied tests, and using a 100% | 300 // current list of field tests to include the supplied tests, and using a 100% |
262 // probability for each test, force them to have the same group string. This | 301 // probability for each test, force them to have the same group string. This |
263 // is commonly used in a non-browser process, to carry randomly selected state | 302 // is commonly used in a non-browser process, to carry randomly selected state |
264 // in a browser process into this non-browser process. This method calls | 303 // in a browser process into this non-browser process. This method calls |
265 // CreateFieldTrial to create the FieldTrial in the non-browser process. | 304 // CreateFieldTrial to create the FieldTrial in the non-browser process. |
266 // Currently only the group_name_ and name_ are restored. | 305 // Currently only the group_name_ and name_ are restored, as well as the |
| 306 // |client_id()| state, that could be used for one-time randomized trials |
| 307 // set up only in child processes. |
267 static bool CreateTrialsInChildProcess(const std::string& prior_trials); | 308 static bool CreateTrialsInChildProcess(const std::string& prior_trials); |
268 | 309 |
269 // Create a FieldTrial with the given |name| and using 100% probability for | 310 // Create a FieldTrial with the given |name| and using 100% probability for |
270 // the FieldTrial, force FieldTrial to have the same group string as | 311 // the FieldTrial, force FieldTrial to have the same group string as |
271 // |group_name|. This is commonly used in a non-browser process, to carry | 312 // |group_name|. This is commonly used in a non-browser process, to carry |
272 // randomly selected state in a browser process into this non-browser process. | 313 // randomly selected state in a browser process into this non-browser process. |
273 // Currently only the group_name_ and name_ are set in the FieldTrial. It | 314 // Currently only the group_name_ and name_ are set in the FieldTrial. It |
274 // returns NULL if there is a FieldTrial that is already registered with the | 315 // returns NULL if there is a FieldTrial that is already registered with the |
275 // same |name| but has different finalized group string (|group_name|). | 316 // same |name| but has different finalized group string (|group_name|). |
276 static FieldTrial* CreateFieldTrial(const std::string& name, | 317 static FieldTrial* CreateFieldTrial(const std::string& name, |
(...skipping 19 matching lines...) Expand all Loading... |
296 static TimeTicks application_start_time() { | 337 static TimeTicks application_start_time() { |
297 if (global_) | 338 if (global_) |
298 return global_->application_start_time_; | 339 return global_->application_start_time_; |
299 // For testing purposes only, or when we don't yet have a start time. | 340 // For testing purposes only, or when we don't yet have a start time. |
300 return TimeTicks::Now(); | 341 return TimeTicks::Now(); |
301 } | 342 } |
302 | 343 |
303 // Return the number of active field trials. | 344 // Return the number of active field trials. |
304 static size_t GetFieldTrialCount(); | 345 static size_t GetFieldTrialCount(); |
305 | 346 |
| 347 // Returns true if you can call |FieldTrial::UseOneTimeRandomization()| |
| 348 // without error, i.e. if a non-empty string was provided as the client_id |
| 349 // when constructing the FieldTrialList singleton. |
| 350 static bool IsOneTimeRandomizationEnabled(); |
| 351 |
| 352 // Returns an opaque, diverse ID for this client that does not change |
| 353 // between sessions. |
| 354 // |
| 355 // Returns the empty string if one-time randomization is not enabled. |
| 356 static const std::string& client_id(); |
| 357 |
306 private: | 358 private: |
307 // A map from FieldTrial names to the actual instances. | 359 // A map from FieldTrial names to the actual instances. |
308 typedef std::map<std::string, FieldTrial*> RegistrationList; | 360 typedef std::map<std::string, FieldTrial*> RegistrationList; |
309 | 361 |
310 // Helper function should be called only while holding lock_. | 362 // Helper function should be called only while holding lock_. |
311 FieldTrial* PreLockedFind(const std::string& name); | 363 FieldTrial* PreLockedFind(const std::string& name); |
312 | 364 |
313 static FieldTrialList* global_; // The singleton of this class. | 365 static FieldTrialList* global_; // The singleton of this class. |
314 | 366 |
315 // This will tell us if there is an attempt to register a field trial without | 367 // This will tell us if there is an attempt to register a field trial without |
316 // creating the FieldTrialList. This is not an error, unless a FieldTrialList | 368 // creating the FieldTrialList. This is not an error, unless a FieldTrialList |
317 // is created after that. | 369 // is created after that. |
318 static bool register_without_global_; | 370 static bool register_without_global_; |
319 | 371 |
320 // A helper value made availabel to users, that shows when the FieldTrialList | 372 // A helper value made available to users, that shows when the FieldTrialList |
321 // was initialized. Note that this is a singleton instance, and hence is a | 373 // was initialized. Note that this is a singleton instance, and hence is a |
322 // good approximation to the start of the process. | 374 // good approximation to the start of the process. |
323 TimeTicks application_start_time_; | 375 TimeTicks application_start_time_; |
324 | 376 |
325 // Lock for access to registered_. | 377 // Lock for access to registered_. |
326 base::Lock lock_; | 378 base::Lock lock_; |
327 RegistrationList registered_; | 379 RegistrationList registered_; |
328 | 380 |
| 381 // An opaque, diverse ID for this client that does not change |
| 382 // between sessions, or the empty string if not initialized. |
| 383 std::string client_id_; |
| 384 |
329 // List of observers to be notified when a group is selected for a FieldTrial. | 385 // List of observers to be notified when a group is selected for a FieldTrial. |
330 ObserverList<Observer> observer_list_; | 386 ObserverList<Observer> observer_list_; |
331 | 387 |
332 DISALLOW_COPY_AND_ASSIGN(FieldTrialList); | 388 DISALLOW_COPY_AND_ASSIGN(FieldTrialList); |
333 }; | 389 }; |
334 | 390 |
335 } // namespace base | 391 } // namespace base |
336 | 392 |
337 #endif // BASE_METRICS_FIELD_TRIAL_H_ | 393 #endif // BASE_METRICS_FIELD_TRIAL_H_ |
338 | |
OLD | NEW |