Chromium Code Reviews| Index: base/metrics/histogram.cc |
| =================================================================== |
| --- base/metrics/histogram.cc (revision 149721) |
| +++ base/metrics/histogram.cc (working copy) |
| @@ -133,7 +133,7 @@ |
| Sample minimum, |
| Sample maximum, |
| size_t bucket_count, |
| - Flags flags) { |
| + int32 flags) { |
| CHECK(InspectConstructionArguments(name, &minimum, &maximum, &bucket_count)); |
| Histogram* histogram = StatisticsRecorder::FindHistogram(name); |
| @@ -160,7 +160,7 @@ |
| TimeDelta minimum, |
| TimeDelta maximum, |
| size_t bucket_count, |
| - Flags flags) { |
| + int32 flags) { |
| return FactoryGet(name, minimum.InMilliseconds(), maximum.InMilliseconds(), |
| bucket_count, flags); |
| } |
| @@ -440,7 +440,6 @@ |
| declared_min_(minimum), |
| declared_max_(maximum), |
| bucket_count_(bucket_count), |
| - flags_(kNoFlags), |
| sample_(bucket_count) {} |
| Histogram::~Histogram() { |
| @@ -463,7 +462,7 @@ |
| } |
| if (*maximum >= kSampleType_MAX) { |
| DVLOG(1) << "Histogram: " << name << " has bad maximum: " << *maximum; |
| - *maximum = kSampleType_MAX - 1; |
| + *maximum = kSampleType_MAX; |
|
Ilya Sherman
2012/08/04 01:18:35
This doesn't seem right -- kSampleType_MAX fails t
kaiwang
2012/08/08 03:59:33
Good catch! It's fixed in another CL
Ilya Sherman
2012/08/08 05:00:29
Ok. In that case, can you move this change into t
kaiwang
2012/08/08 22:17:08
That's already submitted
Ilya Sherman
2012/08/08 22:49:40
Could you rebase this CL, then? It's still showin
kaiwang
2012/08/08 23:03:37
See patch set 4
|
| } |
| if (*bucket_count < 3 || *bucket_count >= kBucketCount_MAX) |
| @@ -522,7 +521,7 @@ |
| const string Histogram::GetAsciiBucketRange(size_t i) const { |
| string result; |
| - if (kHexRangePrintingFlag & flags_) |
| + if (kHexRangePrintingFlag & flags()) |
| StringAppendF(&result, "%#x", ranges(i)); |
| else |
| StringAppendF(&result, "%d", ranges(i)); |
| @@ -627,8 +626,8 @@ |
| StringAppendF(output, ", average = %.1f", average); |
| } |
| - if (flags_ & ~kHexRangePrintingFlag) |
| - StringAppendF(output, " (flags = 0x%x)", flags_ & ~kHexRangePrintingFlag); |
| + if (flags() & ~kHexRangePrintingFlag) |
| + StringAppendF(output, " (flags = 0x%x)", flags() & ~kHexRangePrintingFlag); |
| } |
| void Histogram::WriteAsciiBucketContext(const int64 past, |
| @@ -676,7 +675,7 @@ |
| Sample minimum, |
| Sample maximum, |
| size_t bucket_count, |
| - Flags flags) { |
| + int32 flags) { |
| CHECK(Histogram::InspectConstructionArguments(name, &minimum, &maximum, |
| &bucket_count)); |
| @@ -705,7 +704,7 @@ |
| TimeDelta minimum, |
| TimeDelta maximum, |
| size_t bucket_count, |
| - Flags flags) { |
| + int32 flags) { |
| return FactoryGet(name, minimum.InMilliseconds(), maximum.InMilliseconds(), |
| bucket_count, flags); |
| } |
| @@ -771,7 +770,7 @@ |
| // This section provides implementation for BooleanHistogram. |
| //------------------------------------------------------------------------------ |
| -Histogram* BooleanHistogram::FactoryGet(const string& name, Flags flags) { |
| +Histogram* BooleanHistogram::FactoryGet(const string& name, int32 flags) { |
| Histogram* histogram = StatisticsRecorder::FindHistogram(name); |
| if (!histogram) { |
| // To avoid racy destruction at shutdown, the following will be leaked. |
| @@ -809,7 +808,7 @@ |
| Histogram* CustomHistogram::FactoryGet(const string& name, |
| const vector<Sample>& custom_ranges, |
| - Flags flags) { |
| + int32 flags) { |
| CHECK(ValidateCustomRanges(custom_ranges)); |
| Histogram* histogram = StatisticsRecorder::FindHistogram(name); |