Index: base/trace_event/trace_log.cc |
diff --git a/base/trace_event/trace_log.cc b/base/trace_event/trace_log.cc |
index e3331559d7e849c9768af57ed14577ac255cca50..eed24118a48ff9be7cc79901d5545d7568aa1d33 100644 |
--- a/base/trace_event/trace_log.cc |
+++ b/base/trace_event/trace_log.cc |
@@ -808,10 +808,12 @@ int TraceLog::GetNumTracesRecorded() { |
} |
void TraceLog::AddEnabledStateObserver(EnabledStateObserver* listener) { |
+ AutoLock lock(lock_); |
enabled_state_observer_list_.push_back(listener); |
} |
void TraceLog::RemoveEnabledStateObserver(EnabledStateObserver* listener) { |
+ AutoLock lock(lock_); |
std::vector<EnabledStateObserver*>::iterator it = |
std::find(enabled_state_observer_list_.begin(), |
enabled_state_observer_list_.end(), listener); |
@@ -820,6 +822,7 @@ void TraceLog::RemoveEnabledStateObserver(EnabledStateObserver* listener) { |
} |
bool TraceLog::HasEnabledStateObserver(EnabledStateObserver* listener) const { |
+ AutoLock lock(lock_); |
std::vector<EnabledStateObserver*>::const_iterator it = |
std::find(enabled_state_observer_list_.begin(), |
enabled_state_observer_list_.end(), listener); |