diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/disk_cache/stats_histogram.cc | 12 | ||||
-rw-r--r-- | net/disk_cache/stats_histogram.h | 11 | ||||
-rw-r--r-- | net/socket_stream/socket_stream_metrics_unittest.cc | 6 | ||||
-rw-r--r-- | net/url_request/url_request_throttler_unittest.cc | 2 |
4 files changed, 11 insertions, 20 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 diff --git a/net/disk_cache/stats_histogram.h b/net/disk_cache/stats_histogram.h index 97b2d401..f3af304 100644 --- a/net/disk_cache/stats_histogram.h +++ b/net/disk_cache/stats_histogram.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -29,9 +29,11 @@ class StatsHistogram : public base::Histogram { } }; - StatsHistogram(const std::string& name, Sample minimum, - Sample maximum, size_t bucket_count) - : Histogram(name, minimum, maximum, bucket_count), init_(false) {} + StatsHistogram(const std::string& name, + Sample minimum, + Sample maximum, + size_t bucket_count) + : Histogram(name, minimum, maximum, bucket_count, NULL), init_(false) {} virtual ~StatsHistogram(); static StatsHistogram* FactoryGet(const std::string& name); @@ -44,7 +46,6 @@ class StatsHistogram : public base::Histogram { virtual void SnapshotSample(SampleSet* sample) const OVERRIDE; virtual Inconsistencies FindCorruption( const SampleSet& snapshot) const OVERRIDE; - virtual uint32 CalculateRangeChecksum() const OVERRIDE; private: bool init_; diff --git a/net/socket_stream/socket_stream_metrics_unittest.cc b/net/socket_stream/socket_stream_metrics_unittest.cc index d4daf1e..f644f8d 100644 --- a/net/socket_stream/socket_stream_metrics_unittest.cc +++ b/net/socket_stream/socket_stream_metrics_unittest.cc @@ -41,7 +41,7 @@ TEST(SocketStreamMetricsTest, ProtocolType) { Histogram::SampleSet sample; histogram->SnapshotSample(&sample); - original.Resize(*histogram); // Ensure |original| size is same as |sample|. + original.Resize(histogram->bucket_count()); sample.Subtract(original); // Cancel the original values. EXPECT_EQ(1, sample.counts(SocketStreamMetrics::PROTOCOL_UNKNOWN)); EXPECT_EQ(2, sample.counts(SocketStreamMetrics::PROTOCOL_WEBSOCKET)); @@ -75,7 +75,7 @@ TEST(SocketStreamMetricsTest, ConnectionType) { Histogram::SampleSet sample; histogram->SnapshotSample(&sample); - original.Resize(*histogram); + original.Resize(histogram->bucket_count()); sample.Subtract(original); EXPECT_EQ(1, sample.counts(SocketStreamMetrics::ALL_CONNECTIONS)); EXPECT_EQ(2, sample.counts(SocketStreamMetrics::TUNNEL_CONNECTION)); @@ -106,7 +106,7 @@ TEST(SocketStreamMetricsTest, WireProtocolType) { Histogram::SampleSet sample; histogram->SnapshotSample(&sample); - original.Resize(*histogram); + original.Resize(histogram->bucket_count()); sample.Subtract(original); EXPECT_EQ(3, sample.counts(SocketStreamMetrics::WIRE_PROTOCOL_WEBSOCKET)); EXPECT_EQ(7, sample.counts(SocketStreamMetrics::WIRE_PROTOCOL_SPDY)); diff --git a/net/url_request/url_request_throttler_unittest.cc b/net/url_request/url_request_throttler_unittest.cc index 4721d4c..bc71a4b 100644 --- a/net/url_request/url_request_throttler_unittest.cc +++ b/net/url_request/url_request_throttler_unittest.cc @@ -228,7 +228,7 @@ void URLRequestThrottlerEntryTest::CalculateHistogramDeltas() { histogram->SnapshotSample(&sample); // Ensure |original| size is same as |sample|, then subtract original // values. - original.Resize(*histogram); + original.Resize(histogram->bucket_count()); sample.Subtract(original); } } |