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