Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2127)

Unified Diff: base/metrics/field_trial.cc

Issue 10342021: FieldTrial - Use ObserverListThreadSafe instead of (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/metrics/field_trial.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/metrics/field_trial.cc
===================================================================
--- base/metrics/field_trial.cc (revision 134998)
+++ base/metrics/field_trial.cc (working copy)
@@ -213,7 +213,8 @@
FieldTrialList::FieldTrialList(const std::string& client_id)
: application_start_time_(TimeTicks::Now()),
client_id_(client_id),
- observer_list_(ObserverList<Observer>::NOTIFY_EXISTING_ONLY) {
+ observer_list_(new ObserverListThreadSafe<FieldTrialList::Observer>(
+ ObserverListBase<FieldTrialList::Observer>::NOTIFY_EXISTING_ONLY)) {
DCHECK(!global_);
DCHECK(!used_without_global_);
global_ = this;
@@ -393,7 +394,7 @@
if (!global_)
return;
DCHECK(global_);
- global_->observer_list_.AddObserver(observer);
+ global_->observer_list_->AddObserver(observer);
}
// static
@@ -401,7 +402,7 @@
if (!global_)
return;
DCHECK(global_);
- global_->observer_list_.RemoveObserver(observer);
+ global_->observer_list_->RemoveObserver(observer);
}
// static
@@ -411,9 +412,10 @@
if (!global_)
return;
DCHECK(global_);
- FOR_EACH_OBSERVER(Observer,
- global_->observer_list_,
- OnFieldTrialGroupFinalized(name, group_name));
+ global_->observer_list_->Notify(
+ &FieldTrialList::Observer::OnFieldTrialGroupFinalized,
+ name,
+ group_name);
}
// static
« no previous file with comments | « base/metrics/field_trial.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698