Index: base/metrics/histogram_base.cc |
diff --git a/base/metrics/histogram_base.cc b/base/metrics/histogram_base.cc |
index 6b3f69c2c047a63198d6cf69e94ec6e29336e8b7..92da79f165f465da0fd2a98041fe1bea6f933896 100644 |
--- a/base/metrics/histogram_base.cc |
+++ b/base/metrics/histogram_base.cc |
@@ -72,11 +72,13 @@ void HistogramBase::CheckName(const StringPiece& name) const { |
} |
void HistogramBase::SetFlags(int32 flags) { |
- flags_ |= flags; |
+ HistogramBase::Count old_flags = subtle::NoBarrier_Load(&flags_); |
+ subtle::NoBarrier_Store(&flags_, old_flags | flags); |
Alexander Potapenko
2015/11/18 11:23:28
The question is whether there is any data that is
Alexei Svitkine (slow)
2015/11/18 16:37:12
I don't think there's a case where there is associ
|
} |
void HistogramBase::ClearFlags(int32 flags) { |
- flags_ &= ~flags; |
+ HistogramBase::Count old_flags = subtle::NoBarrier_Load(&flags_); |
+ subtle::NoBarrier_Store(&flags_, old_flags & ~flags); |
} |
void HistogramBase::AddTime(const TimeDelta& time) { |
@@ -119,7 +121,7 @@ void HistogramBase::WriteJSON(std::string* output) const { |
} |
void HistogramBase::FindAndRunCallback(HistogramBase::Sample sample) const { |
- if ((flags_ & kCallbackExists) == 0) |
+ if ((flags() & kCallbackExists) == 0) |
return; |
StatisticsRecorder::OnSampleCallback cb = |