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 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
540 AutoLock auto_lock(global_->lock_); | 540 AutoLock auto_lock(global_->lock_); |
541 if (field_trial->group_reported_) | 541 if (field_trial->group_reported_) |
542 return; | 542 return; |
543 field_trial->group_reported_ = true; | 543 field_trial->group_reported_ = true; |
544 } | 544 } |
545 | 545 |
546 if (!field_trial->enable_field_trial_) | 546 if (!field_trial->enable_field_trial_) |
547 return; | 547 return; |
548 | 548 |
549 global_->observer_list_->Notify( | 549 global_->observer_list_->Notify( |
550 &FieldTrialList::Observer::OnFieldTrialGroupFinalized, | 550 FROM_HERE, &FieldTrialList::Observer::OnFieldTrialGroupFinalized, |
551 field_trial->trial_name(), | 551 field_trial->trial_name(), field_trial->group_name_internal()); |
552 field_trial->group_name_internal()); | |
553 } | 552 } |
554 | 553 |
555 // static | 554 // static |
556 size_t FieldTrialList::GetFieldTrialCount() { | 555 size_t FieldTrialList::GetFieldTrialCount() { |
557 if (!global_) | 556 if (!global_) |
558 return 0; | 557 return 0; |
559 AutoLock auto_lock(global_->lock_); | 558 AutoLock auto_lock(global_->lock_); |
560 return global_->registered_.size(); | 559 return global_->registered_.size(); |
561 } | 560 } |
562 | 561 |
(...skipping 22 matching lines...) Expand all Loading... |
585 return; | 584 return; |
586 } | 585 } |
587 AutoLock auto_lock(global_->lock_); | 586 AutoLock auto_lock(global_->lock_); |
588 DCHECK(!global_->PreLockedFind(trial->trial_name())); | 587 DCHECK(!global_->PreLockedFind(trial->trial_name())); |
589 trial->AddRef(); | 588 trial->AddRef(); |
590 trial->SetTrialRegistered(); | 589 trial->SetTrialRegistered(); |
591 global_->registered_[trial->trial_name()] = trial; | 590 global_->registered_[trial->trial_name()] = trial; |
592 } | 591 } |
593 | 592 |
594 } // namespace base | 593 } // namespace base |
OLD | NEW |