| OLD | NEW |
| 1 // Copyright (c) 2012 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 #include "base/metrics/field_trial.h" | 5 #include "base/metrics/field_trial.h" |
| 6 | 6 |
| 7 #include "base/build_time.h" | 7 #include "base/build_time.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/rand_util.h" | 9 #include "base/rand_util.h" |
| 10 #include "base/sha1.h" | 10 #include "base/sha1.h" |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 if (field_trial) | 311 if (field_trial) |
| 312 return field_trial->group(); | 312 return field_trial->group(); |
| 313 return FieldTrial::kNotFinalized; | 313 return FieldTrial::kNotFinalized; |
| 314 } | 314 } |
| 315 | 315 |
| 316 // static | 316 // static |
| 317 std::string FieldTrialList::FindFullName(const std::string& name) { | 317 std::string FieldTrialList::FindFullName(const std::string& name) { |
| 318 FieldTrial* field_trial = Find(name); | 318 FieldTrial* field_trial = Find(name); |
| 319 if (field_trial) | 319 if (field_trial) |
| 320 return field_trial->group_name(); | 320 return field_trial->group_name(); |
| 321 return ""; | 321 return std::string(); |
| 322 } | 322 } |
| 323 | 323 |
| 324 // static | 324 // static |
| 325 bool FieldTrialList::TrialExists(const std::string& name) { | 325 bool FieldTrialList::TrialExists(const std::string& name) { |
| 326 return Find(name) != NULL; | 326 return Find(name) != NULL; |
| 327 } | 327 } |
| 328 | 328 |
| 329 // static | 329 // static |
| 330 void FieldTrialList::StatesToString(std::string* output) { | 330 void FieldTrialList::StatesToString(std::string* output) { |
| 331 FieldTrial::ActiveGroups active_groups; | 331 FieldTrial::ActiveGroups active_groups; |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 used_without_global_ = true; | 483 used_without_global_ = true; |
| 484 return; | 484 return; |
| 485 } | 485 } |
| 486 AutoLock auto_lock(global_->lock_); | 486 AutoLock auto_lock(global_->lock_); |
| 487 DCHECK(!global_->PreLockedFind(trial->trial_name())); | 487 DCHECK(!global_->PreLockedFind(trial->trial_name())); |
| 488 trial->AddRef(); | 488 trial->AddRef(); |
| 489 global_->registered_[trial->trial_name()] = trial; | 489 global_->registered_[trial->trial_name()] = trial; |
| 490 } | 490 } |
| 491 | 491 |
| 492 } // namespace base | 492 } // namespace base |
| OLD | NEW |