Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(772)

Unified Diff: base/metrics/histogram.h

Issue 11272044: Add explicit tests for histogram factory matching. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: + a comment Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/metrics/bucket_ranges_unittest.cc ('k') | base/metrics/histogram_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/metrics/histogram.h
diff --git a/base/metrics/histogram.h b/base/metrics/histogram.h
index f3104ebb67a343c1f35f02ecdb29bd012e15f4b9..2bdb2ecd1e0a43b0072fd7dfaee02fa7ae3e72f0 100644
--- a/base/metrics/histogram.h
+++ b/base/metrics/histogram.h
@@ -17,6 +17,11 @@
// silently clamped to those limits (for backwards compatibility with existing
// code). Best practice is to not exceed the limits.
+// Each use of a histogram with the same name will reference the same underlying
+// data, so it is safe to record to the same histogram from multiple locations
+// in the code. It is a runtime error if all uses of the same histogram do not
+// agree exactly in type, bucket size and range.
+
// For Histogram and LinearHistogram, the maximum for a declared range should
// always be larger (not equal) than minmal range. Zero and
// HistogramBase::kSampleType_MAX are implicitly added as first and last ranges,
@@ -527,6 +532,7 @@ class BASE_EXPORT Histogram : public HistogramBase {
FRIEND_TEST_ALL_PREFIXES(HistogramTest, BucketPlacementTest);
FRIEND_TEST_ALL_PREFIXES(HistogramTest, CorruptBucketBounds);
FRIEND_TEST_ALL_PREFIXES(HistogramTest, CorruptSampleCounts);
+ FRIEND_TEST_ALL_PREFIXES(HistogramTest, NameMatchTest);
friend class StatisticsRecorder; // To allow it to delete duplicates.
friend class StatisticsRecorderTest;
« no previous file with comments | « base/metrics/bucket_ranges_unittest.cc ('k') | base/metrics/histogram_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698