diff --git a/ipc/chromium/src/base/histogram.cc b/ipc/chromium/src/base/histogram.cc index 999ac4304de..f0794475e8d 100644 --- a/ipc/chromium/src/base/histogram.cc +++ b/ipc/chromium/src/base/histogram.cc @@ -973,6 +973,14 @@ BooleanHistogram::BooleanHistogram(const std::string& name) : LinearHistogram(name, 1, 2, 3) { } +void +BooleanHistogram::Accumulate(Sample value, Count count, size_t index) +{ + // Callers will have computed index based on the non-booleanified value. + // So we need to adjust the index manually. + LinearHistogram::Accumulate(!!value, count, value ? 1 : 0); +} + //------------------------------------------------------------------------------ // FlagHistogram: //------------------------------------------------------------------------------ diff --git a/ipc/chromium/src/base/histogram.h b/ipc/chromium/src/base/histogram.h index 7bea51d20a8..0bebbdcae0b 100644 --- a/ipc/chromium/src/base/histogram.h +++ b/ipc/chromium/src/base/histogram.h @@ -672,6 +672,8 @@ class BooleanHistogram : public LinearHistogram { virtual void AddBoolean(bool value); + virtual void Accumulate(Sample value, Count count, size_t index); + protected: explicit BooleanHistogram(const std::string& name);