| Index: base/metrics/statistics_recorder.cc
|
| ===================================================================
|
| --- base/metrics/statistics_recorder.cc (revision 147155)
|
| +++ base/metrics/statistics_recorder.cc (working copy)
|
| @@ -5,11 +5,18 @@
|
| #include "base/metrics/statistics_recorder.h"
|
|
|
| #include "base/debug/leak_annotations.h"
|
| +#include "base/lazy_instance.h"
|
| #include "base/logging.h"
|
| #include "base/metrics/histogram.h"
|
| #include "base/stringprintf.h"
|
| #include "base/synchronization/lock.h"
|
|
|
| +namespace {
|
| +// Initialize histogram statistics gathering system.
|
| +base::LazyInstance<base::StatisticsRecorder>::Leaky
|
| + g_statistics_recorder_ = LAZY_INSTANCE_INITIALIZER;
|
| +} // namespace
|
| +
|
| namespace base {
|
|
|
| // Collect the number of histograms created.
|
| @@ -67,6 +74,13 @@
|
| }
|
|
|
| // static
|
| +void StatisticsRecorder::Initialize() {
|
| + // Ensure that an instance of the StatisticsRecorder object is created.
|
| + g_statistics_recorder_.Get();
|
| +}
|
| +
|
| +
|
| +// static
|
| bool StatisticsRecorder::IsActive() {
|
| if (lock_ == NULL)
|
| return false;
|
|
|