Index: src/counters.cc |
diff --git a/src/counters.cc b/src/counters.cc |
index c98078658f5fde39478b32619f3360e23e392bd0..cab893c1f5a6362991b5efb01d86e34d6797b771 100644 |
--- a/src/counters.cc |
+++ b/src/counters.cc |
@@ -26,15 +26,18 @@ void StatsTable::SetCounterFunction(CounterLookupCallback f) { |
counters_->ResetCounters(); |
} |
+void StatsTable::SetCreateHistogramFunction(CreateHistogramCallback f) { |
Mircea Trofin
2017/06/05 15:57:49
It's a bit surprising setting the callback (which
kschimpf
2017/06/05 17:38:52
Ok. However, the current name matches the "include
|
+ create_histogram_function_ = f; |
+ counters_->ResetHistograms(); |
+} |
+ |
int* StatsCounterBase::FindLocationInStatsTable() const { |
return counters_->stats_table()->FindLocation(name_); |
} |
StatsCounterThreadSafe::StatsCounterThreadSafe(Counters* counters, |
const char* name) |
- : StatsCounterBase(counters, name) { |
- GetPtr(); |
-} |
+ : StatsCounterBase(counters, name) {} |
void StatsCounterThreadSafe::Set(int Value) { |
if (ptr_) { |
@@ -72,7 +75,6 @@ void StatsCounterThreadSafe::Decrement(int value) { |
} |
int* StatsCounterThreadSafe::GetPtr() { |
- base::LockGuard<base::Mutex> Guard(&mutex_); |
ptr_ = FindLocationInStatsTable(); |
return ptr_; |
} |
@@ -316,29 +318,6 @@ void Counters::ResetHistograms() { |
#undef HM |
} |
-void Counters::InitializeHistograms() { |
-#define HR(name, caption, min, max, num_buckets) name##_.Enabled(); |
- HISTOGRAM_RANGE_LIST(HR) |
-#undef HR |
- |
-#define HT(name, caption, max, res) name##_.Enabled(); |
- HISTOGRAM_TIMER_LIST(HT) |
-#undef HT |
- |
-#define AHT(name, caption) name##_.Enabled(); |
- AGGREGATABLE_HISTOGRAM_TIMER_LIST(AHT) |
-#undef AHT |
- |
-#define HP(name, caption) name##_.Enabled(); |
- HISTOGRAM_PERCENTAGE_LIST(HP) |
-#undef HP |
- |
-#define HM(name, caption) name##_.Enabled(); |
- HISTOGRAM_LEGACY_MEMORY_LIST(HM) |
- HISTOGRAM_MEMORY_LIST(HM) |
-#undef HM |
-} |
- |
class RuntimeCallStatEntries { |
public: |
void Print(std::ostream& os) { |