| Index: base/metrics/statistics_recorder.cc
|
| diff --git a/base/metrics/statistics_recorder.cc b/base/metrics/statistics_recorder.cc
|
| index 2bb50ad3a33da3117475170fbefe152814c3e3e4..9ecd0bf4861d1bd2bccd87b1b086c8868afa1db0 100644
|
| --- a/base/metrics/statistics_recorder.cc
|
| +++ b/base/metrics/statistics_recorder.cc
|
| @@ -11,6 +11,7 @@
|
| #include "base/memory/scoped_ptr.h"
|
| #include "base/metrics/histogram.h"
|
| #include "base/metrics/metrics_hashes.h"
|
| +#include "base/metrics/persistent_histogram_allocator.h"
|
| #include "base/stl_util.h"
|
| #include "base/strings/stringprintf.h"
|
| #include "base/synchronization/lock.h"
|
| @@ -288,6 +289,14 @@ HistogramBase* StatisticsRecorder::FindHistogram(base::StringPiece name) {
|
| if (histograms_ == NULL)
|
| return NULL;
|
|
|
| + // Import histograms from known persistent storage. Histograms could have
|
| + // been added by other processes and they must be fetched and recognized
|
| + // locally. If the persistent memory segment is not shared between processes,
|
| + // this call does nothing.
|
| + GlobalHistogramAllocator* allocator = GlobalHistogramAllocator::Get();
|
| + if (allocator)
|
| + allocator->ImportHistogramsToStatisticsRecorder();
|
| +
|
| HistogramMap::iterator it = histograms_->find(HashMetricName(name));
|
| if (histograms_->end() == it)
|
| return NULL;
|
|
|