| 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 <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/build_time.h" | 9 #include "base/build_time.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 607 { | 607 { |
| 608 AutoLock auto_lock(global_->lock_); | 608 AutoLock auto_lock(global_->lock_); |
| 609 if (field_trial->group_reported_) | 609 if (field_trial->group_reported_) |
| 610 return; | 610 return; |
| 611 field_trial->group_reported_ = true; | 611 field_trial->group_reported_ = true; |
| 612 } | 612 } |
| 613 | 613 |
| 614 if (!field_trial->enable_field_trial_) | 614 if (!field_trial->enable_field_trial_) |
| 615 return; | 615 return; |
| 616 | 616 |
| 617 CheckTrialGroup(field_trial->trial_name(), field_trial->group_name_internal(), | 617 { |
| 618 &global_->seen_states_); | 618 AutoLock auto_lock(global_->lock_); |
| 619 CheckTrialGroup(field_trial->trial_name(), |
| 620 field_trial->group_name_internal(), &global_->seen_states_); |
| 621 } |
| 619 global_->observer_list_->Notify( | 622 global_->observer_list_->Notify( |
| 620 FROM_HERE, &FieldTrialList::Observer::OnFieldTrialGroupFinalized, | 623 FROM_HERE, &FieldTrialList::Observer::OnFieldTrialGroupFinalized, |
| 621 field_trial->trial_name(), field_trial->group_name_internal()); | 624 field_trial->trial_name(), field_trial->group_name_internal()); |
| 622 } | 625 } |
| 623 | 626 |
| 624 // static | 627 // static |
| 625 size_t FieldTrialList::GetFieldTrialCount() { | 628 size_t FieldTrialList::GetFieldTrialCount() { |
| 626 if (!global_) | 629 if (!global_) |
| 627 return 0; | 630 return 0; |
| 628 AutoLock auto_lock(global_->lock_); | 631 AutoLock auto_lock(global_->lock_); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 654 return; | 657 return; |
| 655 } | 658 } |
| 656 AutoLock auto_lock(global_->lock_); | 659 AutoLock auto_lock(global_->lock_); |
| 657 CHECK(!global_->PreLockedFind(trial->trial_name())) << trial->trial_name(); | 660 CHECK(!global_->PreLockedFind(trial->trial_name())) << trial->trial_name(); |
| 658 trial->AddRef(); | 661 trial->AddRef(); |
| 659 trial->SetTrialRegistered(); | 662 trial->SetTrialRegistered(); |
| 660 global_->registered_[trial->trial_name()] = trial; | 663 global_->registered_[trial->trial_name()] = trial; |
| 661 } | 664 } |
| 662 | 665 |
| 663 } // namespace base | 666 } // namespace base |
| OLD | NEW |