summaryrefslogtreecommitdiffstats
path: root/base/histogram.h
diff options
context:
space:
mode:
Diffstat (limited to 'base/histogram.h')
-rw-r--r--base/histogram.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/base/histogram.h b/base/histogram.h
index f56d05f..8b4bded 100644
--- a/base/histogram.h
+++ b/base/histogram.h
@@ -370,6 +370,18 @@ class LinearHistogram : public Histogram {
DISALLOW_EVIL_CONSTRUCTORS(LinearHistogram);
};
+//------------------------------------------------------------------------------
+
+// BooleanHistogram is a histogram for booleans.
+class BooleanHistogram : public LinearHistogram {
+ public:
+ BooleanHistogram(const wchar_t* name) : LinearHistogram(name, 0, 2, 3) {}
+
+ virtual void AddBoolean(bool value) { Add(value ? 1 : 0); }
+
+ private:
+ DISALLOW_EVIL_CONSTRUCTORS(BooleanHistogram);
+};
//------------------------------------------------------------------------------
// This section provides implementation for ThreadSafeHistogram.