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

Unified Diff: base/metrics/histogram.h

Issue 141393002: Return a NULL histogram pointer on construction error (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add construction param to restore old CHECK for non-API calls Created 6 years, 11 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 | « no previous file | base/metrics/histogram.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 9845362d98aa31cad7557383e2fc1e039ad5f67e..090fb57c51a0d0a70a1b0ee9159f98a74334a937 100644
--- a/base/metrics/histogram.h
+++ b/base/metrics/histogram.h
@@ -385,16 +385,20 @@ class BASE_EXPORT Histogram : public HistogramBase {
// buckets <= (maximum - minimum + 2) - this is to ensure that we don't have
// more buckets than the range of numbers; having more buckets than 1 per
// value in the range would be nonsensical.
- static HistogramBase* FactoryGet(const std::string& name,
- Sample minimum,
- Sample maximum,
- size_t bucket_count,
- int32 flags);
- static HistogramBase* FactoryTimeGet(const std::string& name,
- base::TimeDelta minimum,
- base::TimeDelta maximum,
- size_t bucket_count,
- int32 flags);
+ static HistogramBase* FactoryGet(
+ const std::string& name,
+ Sample minimum,
+ Sample maximum,
+ size_t bucket_count,
+ int32 flags,
+ int32 construction_behavior = kDoNotAllowBadConstruction);
jar (doing other things) 2014/01/24 16:15:09 Sadly, this is a violation of the style guide. Pe
elijahtaylor1 2014/01/24 20:37:22 If allowing NULL dereference is ok for what we're
+ static HistogramBase* FactoryTimeGet(
+ const std::string& name,
+ base::TimeDelta minimum,
+ base::TimeDelta maximum,
+ size_t bucket_count,
+ int32 flags,
+ int32 construction_behavior = kDoNotAllowBadConstruction);
// Time call for use with DHISTOGRAM*.
// Returns TimeTicks::Now() in debug and TimeTicks() in release build.
@@ -546,16 +550,19 @@ class BASE_EXPORT LinearHistogram : public Histogram {
/* minimum should start from 1. 0 is as minimum is invalid. 0 is an implicit
default underflow bucket. */
- static HistogramBase* FactoryGet(const std::string& name,
- Sample minimum,
- Sample maximum,
- size_t bucket_count,
- int32 flags);
+ static HistogramBase* FactoryGet(
+ const std::string& name,
+ Sample minimum,
+ Sample maximum,
+ size_t bucket_count,
+ int32 flags,
+ int32 construction_behavior = kDoNotAllowBadConstruction);
static HistogramBase* FactoryTimeGet(const std::string& name,
- TimeDelta minimum,
- TimeDelta maximum,
- size_t bucket_count,
- int32 flags);
+ TimeDelta minimum,
+ TimeDelta maximum,
+ size_t bucket_count,
+ int32 flags,
+ int32 construction_behavior = kDoNotAllowBadConstruction);
struct DescriptionPair {
Sample sample;
@@ -573,7 +580,8 @@ class BASE_EXPORT LinearHistogram : public Histogram {
Sample maximum,
size_t bucket_count,
int32 flags,
- const DescriptionPair descriptions[]);
+ const DescriptionPair descriptions[],
+ int32 construction_behavior = kDoNotAllowBadConstruction);
static void InitializeBucketRanges(Sample minimum,
Sample maximum,
« no previous file with comments | « no previous file | base/metrics/histogram.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698