| Index: chrome/browser/chromeos/external_metrics.cc
|
| diff --git a/chrome/browser/chromeos/external_metrics.cc b/chrome/browser/chromeos/external_metrics.cc
|
| index bdb4b5e2486c1a5c28bde0a6b00951897618a373..138cfcca1cdef0c86ce5cceeb0a37cf9bbe052ce 100644
|
| --- a/chrome/browser/chromeos/external_metrics.cc
|
| +++ b/chrome/browser/chromeos/external_metrics.cc
|
| @@ -19,6 +19,7 @@
|
| #include "base/bind.h"
|
| #include "base/eintr_wrapper.h"
|
| #include "base/metrics/histogram.h"
|
| +#include "base/metrics/statistics_recorder.h"
|
| #include "base/perftimer.h"
|
| #include "base/time.h"
|
| #include "chrome/browser/browser_process.h"
|
| @@ -43,6 +44,14 @@ class SystemHistogram : public base::Histogram {
|
| return base::Histogram::InspectConstructionArguments(
|
| name, &minimum, &maximum, &bucket_count);
|
| }
|
| + static bool CheckLinearValues(const std::string& name, int maximum) {
|
| + if (!CheckValues(name, 1, maximum, maximum + 1))
|
| + return false;
|
| + Histogram* histogram = base::StatisticsRecorder::FindHistogram(name);
|
| + if (!histogram)
|
| + return true;
|
| + return histogram->HasConstructionArguments(1, maximum, maximum + 1);
|
| + }
|
| };
|
|
|
| ExternalMetrics::ExternalMetrics()
|
| @@ -124,7 +133,7 @@ void ExternalMetrics::RecordLinearHistogram(const char* histogram_data) {
|
| return;
|
| }
|
|
|
| - if (!SystemHistogram::CheckValues(name, 1, max, max + 1)) {
|
| + if (!SystemHistogram::CheckLinearValues(name, max)) {
|
| LOG(ERROR) << "Invalid linear histogram " << name
|
| << ", max=" << max;
|
| return;
|
|
|