Index: base/metrics/statistics_recorder.cc |
diff --git a/base/metrics/statistics_recorder.cc b/base/metrics/statistics_recorder.cc |
index 0840c9affde910bff0f4d3725964db009ae77437..460c75e8491c9c853389a0744172e08315066c4a 100644 |
--- a/base/metrics/statistics_recorder.cc |
+++ b/base/metrics/statistics_recorder.cc |
@@ -12,6 +12,7 @@ |
#include "base/logging.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" |
@@ -289,6 +290,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; |