summaryrefslogtreecommitdiffstats
path: root/net/disk_cache/stats_histogram.cc
diff options
context:
space:
mode:
authorkaiwang@chromium.org <kaiwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-01 21:34:08 +0000
committerkaiwang@chromium.org <kaiwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-01 21:34:08 +0000
commit34d062327516ae2496646d4c4d644e0e12386a3d (patch)
treed92e5703447f10aea57b1bdcfea060600252be9b /net/disk_cache/stats_histogram.cc
parentba125e774ed899bd119bcd9abd47dab68857315b (diff)
downloadchromium_src-34d062327516ae2496646d4c4d644e0e12386a3d.zip
chromium_src-34d062327516ae2496646d4c4d644e0e12386a3d.tar.gz
chromium_src-34d062327516ae2496646d4c4d644e0e12386a3d.tar.bz2
This is a major refactor of Histogram related code:
1. Remove duplicated code from histogram.h/.cc, including validating related code and BucketRanges related. 2. Constness of BucketRanges from Histograms, to prevent accidentally modification and provide a simpler interface. 3. Add/move tests. Review URL: https://chromiumcodereview.appspot.com/10834011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149495 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/stats_histogram.cc')
-rw-r--r--net/disk_cache/stats_histogram.cc12
1 files changed, 1 insertions, 11 deletions
diff --git a/net/disk_cache/stats_histogram.cc b/net/disk_cache/stats_histogram.cc
index 66c8e50..d3bab34 100644
--- a/net/disk_cache/stats_histogram.cc
+++ b/net/disk_cache/stats_histogram.cc
@@ -33,20 +33,16 @@ StatsHistogram* StatsHistogram::FactoryGet(const std::string& name) {
// To avoid racy destruction at shutdown, the following will be leaked.
StatsHistogram* stats_histogram =
new StatsHistogram(name, minimum, maximum, bucket_count);
- stats_histogram->InitializeBucketRange();
stats_histogram->SetFlags(kUmaTargetedHistogramFlag);
histogram = StatisticsRecorder::RegisterOrDeleteDuplicate(stats_histogram);
}
DCHECK(HISTOGRAM == histogram->histogram_type());
- DCHECK(histogram->HasConstructorArguments(minimum, maximum, bucket_count));
+ DCHECK(histogram->HasConstructionArguments(minimum, maximum, bucket_count));
// We're preparing for an otherwise unsafe upcast by ensuring we have the
// proper class type.
StatsHistogram* return_histogram = static_cast<StatsHistogram*>(histogram);
- // Validate upcast by seeing that we're probably providing the checksum.
- CHECK_EQ(return_histogram->StatsHistogram::CalculateRangeChecksum(),
- return_histogram->CalculateRangeChecksum());
return return_histogram;
}
@@ -87,10 +83,4 @@ Histogram::Inconsistencies StatsHistogram::FindCorruption(
return NO_INCONSISTENCIES; // This class won't monitor inconsistencies.
}
-uint32 StatsHistogram::CalculateRangeChecksum() const {
- // We don't calculate checksums, so at least establish a unique constant.
- const uint32 kStatsHistogramChecksum = 0x0cecce;
- return kStatsHistogramChecksum;
-}
-
} // namespace disk_cache