Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 96 // hashes of the trial and group name strings. | 96 // hashes of the trial and group name strings. |
| 97 struct NameGroupId { | 97 struct NameGroupId { |
| 98 uint32 name; | 98 uint32 name; |
| 99 uint32 group; | 99 uint32 group; |
| 100 }; | 100 }; |
| 101 | 101 |
| 102 // A return value to indicate that a given instance has not yet had a group | 102 // A return value to indicate that a given instance has not yet had a group |
| 103 // assignment (and hence is not yet participating in the trial). | 103 // assignment (and hence is not yet participating in the trial). |
| 104 static const int kNotFinalized; | 104 static const int kNotFinalized; |
| 105 | 105 |
| 106 // This is the group number of the 'default' group. This provides an easy way | |
| 107 // to assign all the remaining probability to a group ('default'). | |
| 108 static const int kDefaultGroupNumber; | |
| 109 | |
| 110 // The name is used to register the instance with the FieldTrialList class, | |
| 111 // and can be used to find the trial (only one trial can be present for each | |
| 112 // name). |name| and |default_group_name| may not be empty. | |
| 113 // | |
| 114 // Group probabilities that are later supplied must sum to less than or equal | |
| 115 // to the total_probability. Arguments year, month and day_of_month specify | |
| 116 // the expiration time. If the build time is after the expiration time then | |
| 117 // the field trial reverts to the 'default' group. | |
| 118 // | |
| 119 // Using this constructor creates a startup-randomized FieldTrial. If you | |
| 120 // want a one-time randomized trial, call UseOneTimeRandomization() right | |
| 121 // after construction. | |
| 122 FieldTrial(const std::string& name, Probability total_probability, | |
| 123 const std::string& default_group_name, const int year, | |
| 124 const int month, const int day_of_month); | |
| 125 | |
| 126 // Changes the field trial to use one-time randomization, i.e. produce the | 106 // Changes the field trial to use one-time randomization, i.e. produce the |
| 127 // same result for the current trial on every run of this client. Must be | 107 // same result for the current trial on every run of this client. Must be |
| 128 // called right after construction. | 108 // called right after construction. |
| 129 void UseOneTimeRandomization(); | 109 void UseOneTimeRandomization(); |
| 130 | 110 |
| 131 // Disables this trial, meaning it always determines the default group | 111 // Disables this trial, meaning it always determines the default group |
| 132 // has been selected. May be called immediately after construction, or | 112 // has been selected. May be called immediately after construction, or |
| 133 // at any time after initialization (should not be interleaved with | 113 // at any time after initialization (should not be interleaved with |
| 134 // AppendGroup calls). Once disabled, there is no way to re-enable a | 114 // AppendGroup calls). Once disabled, there is no way to re-enable a |
| 135 // trial. | 115 // trial. |
| 116 // TODO(mad): http://code.google.com/p/chromium/issues/detail?id=121446 | |
| 117 // This doesn't properly reset to Default when a group was forced. | |
| 136 void Disable(); | 118 void Disable(); |
| 137 | 119 |
| 138 // Establish the name and probability of the next group in this trial. | 120 // Establish the name and probability of the next group in this trial. |
| 139 // Sometimes, based on construction randomization, this call may cause the | 121 // Sometimes, based on construction randomization, this call may cause the |
| 140 // provided group to be *THE* group selected for use in this instance. | 122 // provided group to be *THE* group selected for use in this instance. |
| 141 // The return value is the group number of the new group. | 123 // The return value is the group number of the new group. |
| 142 int AppendGroup(const std::string& name, Probability group_probability); | 124 int AppendGroup(const std::string& name, Probability group_probability); |
| 143 | 125 |
| 144 // Return the name of the FieldTrial (excluding the group name). | 126 // Return the name of the FieldTrial (excluding the group name). |
| 145 std::string name() const { return name_; } | 127 std::string name() const { return name_; } |
| 146 | 128 |
| 147 // Return the randomly selected group number that was assigned. | 129 // Return the randomly selected group number that was assigned. |
| 148 // Return kDefaultGroupNumber if the instance is in the 'default' group. | |
| 149 // Note that this will force an instance to participate, and make it illegal | 130 // Note that this will force an instance to participate, and make it illegal |
| 150 // to attempt to probabilistically add any other groups to the trial. | 131 // to attempt to probabilistically add any other groups to the trial. |
| 151 int group(); | 132 int group(); |
| 152 | 133 |
| 153 // If the group's name is empty, a string version containing the group | 134 // If the group's name is empty, a string version containing the group number |
| 154 // number is used as the group name. | 135 // is used as the group name. This causes a winner to be chosen if none was. |
| 155 std::string group_name(); | 136 std::string group_name(); |
| 156 | 137 |
| 157 // Gets the unique identifier of the Field Trial, but only if a group was | 138 // Gets the unique identifier of the Field Trial, but only if a group was |
| 158 // officially chosen, otherwise name_group_id is left untouched and false | 139 // officially chosen, otherwise name_group_id is left untouched and false |
| 159 // is returned. When true is returned, the name and group ids were successfuly | 140 // is returned. When true is returned, the name and group ids were |
| 160 // set in name_group_id. | 141 // successfully set in name_group_id. |
| 161 bool GetNameGroupId(NameGroupId* name_group_id); | 142 bool GetNameGroupId(NameGroupId* name_group_id); |
| 162 | 143 |
| 163 // Return the default group name of the FieldTrial. | |
| 164 std::string default_group_name() const { return default_group_name_; } | |
| 165 | |
| 166 // Helper function for the most common use: as an argument to specify the | 144 // Helper function for the most common use: as an argument to specify the |
| 167 // name of a HISTOGRAM. Use the original histogram name as the name_prefix. | 145 // name of a HISTOGRAM. Use the original histogram name as the name_prefix. |
| 168 static std::string MakeName(const std::string& name_prefix, | 146 static std::string MakeName(const std::string& name_prefix, |
| 169 const std::string& trial_name); | 147 const std::string& trial_name); |
| 170 | 148 |
| 171 // Enable benchmarking sets field trials to a common setting. | 149 // Enable benchmarking sets field trials to a common setting. |
| 172 static void EnableBenchmarking(); | 150 static void EnableBenchmarking(); |
| 173 | 151 |
| 174 private: | 152 private: |
| 175 // Allow tests to access our innards for testing purposes. | 153 // Allow tests to access our innards for testing purposes. |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 186 FRIEND_TEST_ALL_PREFIXES(FieldTrialTest, HashClientId); | 164 FRIEND_TEST_ALL_PREFIXES(FieldTrialTest, HashClientId); |
| 187 FRIEND_TEST_ALL_PREFIXES(FieldTrialTest, HashClientIdIsUniform); | 165 FRIEND_TEST_ALL_PREFIXES(FieldTrialTest, HashClientIdIsUniform); |
| 188 FRIEND_TEST_ALL_PREFIXES(FieldTrialTest, HashName); | 166 FRIEND_TEST_ALL_PREFIXES(FieldTrialTest, HashName); |
| 189 FRIEND_TEST_ALL_PREFIXES(FieldTrialTest, NameGroupIds); | 167 FRIEND_TEST_ALL_PREFIXES(FieldTrialTest, NameGroupIds); |
| 190 FRIEND_TEST_ALL_PREFIXES(FieldTrialTest, UseOneTimeRandomization); | 168 FRIEND_TEST_ALL_PREFIXES(FieldTrialTest, UseOneTimeRandomization); |
| 191 | 169 |
| 192 friend class base::FieldTrialList; | 170 friend class base::FieldTrialList; |
| 193 | 171 |
| 194 friend class RefCounted<FieldTrial>; | 172 friend class RefCounted<FieldTrial>; |
| 195 | 173 |
| 174 // This is the group number of the 'default' group when a choice wasn't forced | |
| 175 // by a call to FieldTrialList::CreateFieldTrial. It is kept private so that | |
| 176 // consumers don't use it by mistake in cases where the group was forced. | |
| 177 static const int kDefaultGroupNumber; | |
| 178 | |
| 179 FieldTrial(const std::string& name, Probability total_probability, | |
| 180 const std::string& default_group_name, const int year, | |
| 181 const int month, const int day_of_month); | |
| 196 virtual ~FieldTrial(); | 182 virtual ~FieldTrial(); |
| 197 | 183 |
| 184 // Return the default group name of the FieldTrial. | |
| 185 std::string default_group_name() const { return default_group_name_; } | |
| 186 | |
| 198 // Returns the group_name. A winner need not have been chosen. | 187 // Returns the group_name. A winner need not have been chosen. |
| 199 std::string group_name_internal() const { return group_name_; } | 188 std::string group_name_internal() const { return group_name_; } |
| 200 | 189 |
| 201 // Calculates a uniformly-distributed double between [0.0, 1.0) given | 190 // Calculates a uniformly-distributed double between [0.0, 1.0) given |
| 202 // a |client_id| and a |trial_name| (the latter is used as salt to avoid | 191 // a |client_id| and a |trial_name| (the latter is used as salt to avoid |
| 203 // separate one-time randomized trials from all having the same results). | 192 // separate one-time randomized trials from all having the same results). |
| 204 static double HashClientId(const std::string& client_id, | 193 static double HashClientId(const std::string& client_id, |
| 205 const std::string& trial_name); | 194 const std::string& trial_name); |
| 206 | 195 |
| 207 // Creates unique identifier for the trial by hashing a name string, whether | 196 // Creates unique identifier for the trial by hashing a name string, whether |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 240 std::string group_name_; | 229 std::string group_name_; |
| 241 | 230 |
| 242 // The hashed name of the group to be sent as a unique identifier. | 231 // The hashed name of the group to be sent as a unique identifier. |
| 243 // Is not valid while group_ is equal to kNotFinalized. | 232 // Is not valid while group_ is equal to kNotFinalized. |
| 244 uint32 group_name_hash_; | 233 uint32 group_name_hash_; |
| 245 | 234 |
| 246 // When enable_field_trial_ is false, field trial reverts to the 'default' | 235 // When enable_field_trial_ is false, field trial reverts to the 'default' |
| 247 // group. | 236 // group. |
| 248 bool enable_field_trial_; | 237 bool enable_field_trial_; |
| 249 | 238 |
| 239 // When forced_ is true, we return the chosen group from AppendGroup when | |
| 240 // appropriate. | |
| 241 bool forced_; | |
| 242 | |
| 250 // When benchmarking is enabled, field trials all revert to the 'default' | 243 // When benchmarking is enabled, field trials all revert to the 'default' |
| 251 // group. | 244 // group. |
| 252 static bool enable_benchmarking_; | 245 static bool enable_benchmarking_; |
| 253 | 246 |
| 254 // This value is reserved for an uninitialized hash value. | 247 // This value is reserved for an uninitialized hash value. |
| 255 static const uint32 kReservedHashValue; | 248 static const uint32 kReservedHashValue; |
| 256 | 249 |
| 257 DISALLOW_COPY_AND_ASSIGN(FieldTrial); | 250 DISALLOW_COPY_AND_ASSIGN(FieldTrial); |
| 258 }; | 251 }; |
| 259 | 252 |
| 260 //------------------------------------------------------------------------------ | 253 //------------------------------------------------------------------------------ |
| 261 // Class with a list of all active field trials. A trial is active if it has | 254 // Class with a list of all active field trials. A trial is active if it has |
| 262 // been registered, which includes evaluating its state based on its probaility. | 255 // been registered, which includes evaluating its state based on its probaility. |
| 263 // Only one instance of this class exists. | 256 // Only one instance of this class exists. |
| 264 class BASE_EXPORT FieldTrialList { | 257 class BASE_EXPORT FieldTrialList { |
| 265 public: | 258 public: |
| 266 // Define a separator charactor to use when creating a persistent form of an | 259 // Define a separator character to use when creating a persistent form of an |
| 267 // instance. This is intended for use as a command line argument, passed to a | 260 // instance. This is intended for use as a command line argument, passed to a |
| 268 // second process to mimic our state (i.e., provide the same group name). | 261 // second process to mimic our state (i.e., provide the same group name). |
| 269 static const char kPersistentStringSeparator; // Currently a slash. | 262 static const char kPersistentStringSeparator; // Currently a slash. |
| 270 | 263 |
| 271 // Define expiration year in future. It is initialized to two years from Now. | 264 // Define expiration year in future. It is initialized to two years from Now. |
| 272 static int kExpirationYearInFuture; | 265 static int kExpirationYearInFuture; |
| 273 | 266 |
| 274 // Observer is notified when a FieldTrial's group is selected. | 267 // Observer is notified when a FieldTrial's group is selected. |
| 275 class Observer { | 268 class Observer { |
| 276 public: | 269 public: |
| 277 // Notify observers when FieldTrials's group is selected. | 270 // Notify observers when FieldTrials's group is selected. |
| 278 virtual void OnFieldTrialGroupFinalized(const std::string& trial_name, | 271 virtual void OnFieldTrialGroupFinalized(const std::string& trial_name, |
| 279 const std::string& group_name) = 0; | 272 const std::string& group_name) = 0; |
| 280 | 273 |
| 281 protected: | 274 protected: |
| 282 virtual ~Observer() {} | 275 virtual ~Observer() {} |
| 283 }; | 276 }; |
| 284 | 277 |
| 285 // This singleton holds the global list of registered FieldTrials. | 278 // This singleton holds the global list of registered FieldTrials. |
| 286 // | 279 // |
| 287 // |client_id| should be an opaque, diverse ID for this client that does not | 280 // |client_id| should be an opaque, diverse ID for this client that does not |
| 288 // change between sessions, to enable one-time randomized trials. The empty | 281 // change between sessions, to enable one-time randomized trials. The empty |
| 289 // string may be provided, in which case one-time randomized trials will | 282 // string may be provided, in which case one-time randomized trials will |
| 290 // not be available. | 283 // not be available. |
| 291 explicit FieldTrialList(const std::string& client_id); | 284 explicit FieldTrialList(const std::string& client_id); |
| 292 // Destructor Release()'s references to all registered FieldTrial instances. | 285 // Destructor Release()'s references to all registered FieldTrial instances. |
| 293 ~FieldTrialList(); | 286 ~FieldTrialList(); |
| 294 | 287 |
| 295 // Register() stores a pointer to the given trial in a global map. | 288 // Creates a new FieldTrial instance if none exists already. If one exists, |
| 296 // This method also AddRef's the indicated trial. | 289 // it has to be because it was forced by CreateFieldTrial. |
|
jar (doing other things)
2012/04/06 01:41:29
nit: I had to read the sentence a few times, and s
MAD
2012/04/11 02:38:08
OK, I agree, I like this picture... Thanks!
Done.
| |
| 297 static void Register(FieldTrial* trial); | 290 // |
| 291 // |name| is used to register the instance with the FieldTrialList class, | |
| 292 // and can be used to find the trial (only one trial can be present for each | |
| 293 // name). |default_group_name| is the name of the default group which will | |
| 294 // be chosen if none of the subsequent appended groups get to be chosen. | |
| 295 // |default_group_number| can receive the group number of the default group as | |
| 296 // AppendGroup returns the number of the subsequence groups. |name| and | |
| 297 // |default_group_name| may not be empty but |default_group_number| can be | |
| 298 // NULL if the value is not needed. | |
| 299 // | |
| 300 // Group probabilities that are later supplied must sum to less than or equal | |
| 301 // to the |total_probability|. Arguments |year|, |month| and |day_of_month| | |
| 302 // specify the expiration time. If the build time is after the expiration time | |
| 303 // then the field trial reverts to the 'default' group. | |
| 304 // | |
| 305 // Use this static method to get a startup-randomized FieldTrial or a | |
| 306 // previously created forced FieldTrial. If you want a one-time randomized | |
| 307 // trial, call UseOneTimeRandomization() right after creation. | |
| 308 static FieldTrial* GetFieldTrialInstance( | |
| 309 const std::string& name, FieldTrial::Probability total_probability, | |
|
jar (doing other things)
2012/04/06 01:41:29
nit: I think it is more readable with one paramete
MAD
2012/04/11 02:38:08
Done.
| |
| 310 const std::string& default_group_name, int* default_group_number, | |
|
jar (doing other things)
2012/04/06 01:41:29
Since the return group number is a "return argumen
MAD
2012/04/11 02:38:08
Done.
| |
| 311 const int year, const int month, const int day_of_month); | |
| 298 | 312 |
| 299 // The Find() method can be used to test to see if a named Trial was already | 313 // The Find() method can be used to test to see if a named Trial was already |
| 300 // registered, or to retrieve a pointer to it from the global map. | 314 // registered, or to retrieve a pointer to it from the global map. |
| 301 static FieldTrial* Find(const std::string& name); | 315 static FieldTrial* Find(const std::string& name); |
| 302 | 316 |
| 303 // Returns the group number chosen for the named trial, or | 317 // Returns the group number chosen for the named trial, or |
| 304 // FieldTrial::kNotFinalized if the trial does not exist. | 318 // FieldTrial::kNotFinalized if the trial does not exist. |
| 305 static int FindValue(const std::string& name); | 319 static int FindValue(const std::string& name); |
| 306 | 320 |
| 307 // Returns the group name chosen for the named trial, or the | 321 // Returns the group name chosen for the named trial, or the |
| 308 // empty string if the trial does not exist. | 322 // empty string if the trial does not exist. |
| 309 static std::string FindFullName(const std::string& name); | 323 static std::string FindFullName(const std::string& name); |
| 310 | 324 |
| 311 // Returns true if the named trial has been registered. | 325 // Returns true if the named trial has been registered. |
| 312 static bool TrialExists(const std::string& name); | 326 static bool TrialExists(const std::string& name); |
| 313 | 327 |
| 314 // Create a persistent representation of all FieldTrial instances and the | 328 // Creates a persistent representation of all FieldTrial instances for |
| 315 // |client_id()| state for resurrection in another process. This allows | 329 // resurrection in another process. This allows randomization to be done in |
| 316 // randomization to be done in one process, and secondary processes can be | 330 // one process, and secondary processes can be synchronized on the result. |
| 317 // synchronized on the result. The resulting string contains the | 331 // The resulting string contains the name and group name pairs for all trials, |
| 318 // |client_id()|, the names, the trial name, and a "/" separator. | 332 // with "/" used to separate all names and to terminate the string. This |
| 333 // string is parsed by CreateTrialsFromString(). | |
| 319 static void StatesToString(std::string* output); | 334 static void StatesToString(std::string* output); |
| 320 | 335 |
| 321 // Returns an array of Unique IDs for each Field Trial that has a chosen | 336 // Returns an array of Unique IDs for each Field Trial that has a chosen |
| 322 // group. Field Trials for which a group has not been chosen yet are NOT | 337 // group. Field Trials for which a group has not been chosen yet are NOT |
| 323 // returned in this list. | 338 // returned in this list. |
| 324 static void GetFieldTrialNameGroupIds( | 339 static void GetFieldTrialNameGroupIds( |
| 325 std::vector<FieldTrial::NameGroupId>* name_group_ids); | 340 std::vector<FieldTrial::NameGroupId>* name_group_ids); |
| 326 | 341 |
| 327 // Use a previously generated state string (re: StatesToString()) augment the | 342 // Use a state string (re: StatesToString()) to augment the current list of |
| 328 // current list of field tests to include the supplied tests, and using a 100% | 343 // field tests to include the supplied tests, and using a 100% probability for |
| 329 // probability for each test, force them to have the same group string. This | 344 // each test, force them to have the same group string. This is commonly used |
| 330 // is commonly used in a non-browser process, to carry randomly selected state | 345 // in a non-browser process, to carry randomly selected state in a browser |
| 331 // in a browser process into this non-browser process. This method calls | 346 // process into this non-browser process, but could also be invoked through a |
| 332 // CreateFieldTrial to create the FieldTrial in the non-browser process. | 347 // command line argument to the browser process. |
| 333 // Currently only the group_name_ and name_ are restored, as well as the | 348 static bool CreateTrialsFromString(const std::string& prior_trials); |
| 334 // |client_id()| state, that could be used for one-time randomized trials | |
| 335 // set up only in child processes. | |
| 336 static bool CreateTrialsInChildProcess(const std::string& prior_trials); | |
| 337 | 349 |
| 338 // Create a FieldTrial with the given |name| and using 100% probability for | 350 // Create a FieldTrial with the given |name| and using 100% probability for |
| 339 // the FieldTrial, force FieldTrial to have the same group string as | 351 // the FieldTrial, force FieldTrial to have the same group string as |
| 340 // |group_name|. This is commonly used in a non-browser process, to carry | 352 // |group_name|. This is commonly used in a non-browser process, to carry |
| 341 // randomly selected state in a browser process into this non-browser process. | 353 // randomly selected state in a browser process into this non-browser process. |
| 342 // Currently only the group_name_ and name_ are set in the FieldTrial. It | 354 // It returns NULL if there is a FieldTrial that is already registered with |
| 343 // returns NULL if there is a FieldTrial that is already registered with the | 355 // the same |name| but has different finalized group string (|group_name|). |
| 344 // same |name| but has different finalized group string (|group_name|). | |
| 345 static FieldTrial* CreateFieldTrial(const std::string& name, | 356 static FieldTrial* CreateFieldTrial(const std::string& name, |
| 346 const std::string& group_name); | 357 const std::string& group_name); |
| 347 | 358 |
| 348 // Add an observer to be notified when a field trial is irrevocably committed | 359 // Add an observer to be notified when a field trial is irrevocably committed |
| 349 // to being part of some specific field_group (and hence the group_name is | 360 // to being part of some specific field_group (and hence the group_name is |
| 350 // also finalized for that field_trial). | 361 // also finalized for that field_trial). |
| 351 static void AddObserver(Observer* observer); | 362 static void AddObserver(Observer* observer); |
| 352 | 363 |
| 353 // Remove an observer. | 364 // Remove an observer. |
| 354 static void RemoveObserver(Observer* observer); | 365 static void RemoveObserver(Observer* observer); |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 383 // Returns the empty string if one-time randomization is not enabled. | 394 // Returns the empty string if one-time randomization is not enabled. |
| 384 static const std::string& client_id(); | 395 static const std::string& client_id(); |
| 385 | 396 |
| 386 private: | 397 private: |
| 387 // A map from FieldTrial names to the actual instances. | 398 // A map from FieldTrial names to the actual instances. |
| 388 typedef std::map<std::string, FieldTrial*> RegistrationList; | 399 typedef std::map<std::string, FieldTrial*> RegistrationList; |
| 389 | 400 |
| 390 // Helper function should be called only while holding lock_. | 401 // Helper function should be called only while holding lock_. |
| 391 FieldTrial* PreLockedFind(const std::string& name); | 402 FieldTrial* PreLockedFind(const std::string& name); |
| 392 | 403 |
| 404 // Register() stores a pointer to the given trial in a global map. | |
| 405 // This method also AddRef's the indicated trial. | |
| 406 // This should always be called after creating a new FieldTrial instance. | |
| 407 static void Register(FieldTrial* trial); | |
| 408 | |
| 393 static FieldTrialList* global_; // The singleton of this class. | 409 static FieldTrialList* global_; // The singleton of this class. |
| 394 | 410 |
| 395 // This will tell us if there is an attempt to register a field | 411 // This will tell us if there is an attempt to register a field |
| 396 // trial or check if one-time randomization is enabled without | 412 // trial or check if one-time randomization is enabled without |
| 397 // creating the FieldTrialList. This is not an error, unless a | 413 // creating the FieldTrialList. This is not an error, unless a |
| 398 // FieldTrialList is created after that. | 414 // FieldTrialList is created after that. |
| 399 static bool used_without_global_; | 415 static bool used_without_global_; |
| 400 | 416 |
| 401 // A helper value made available to users, that shows when the FieldTrialList | 417 // A helper value made available to users, that shows when the FieldTrialList |
| 402 // was initialized. Note that this is a singleton instance, and hence is a | 418 // was initialized. Note that this is a singleton instance, and hence is a |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 413 | 429 |
| 414 // List of observers to be notified when a group is selected for a FieldTrial. | 430 // List of observers to be notified when a group is selected for a FieldTrial. |
| 415 ObserverList<Observer> observer_list_; | 431 ObserverList<Observer> observer_list_; |
| 416 | 432 |
| 417 DISALLOW_COPY_AND_ASSIGN(FieldTrialList); | 433 DISALLOW_COPY_AND_ASSIGN(FieldTrialList); |
| 418 }; | 434 }; |
| 419 | 435 |
| 420 } // namespace base | 436 } // namespace base |
| 421 | 437 |
| 422 #endif // BASE_METRICS_FIELD_TRIAL_H_ | 438 #endif // BASE_METRICS_FIELD_TRIAL_H_ |
| OLD | NEW |