1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef NET_DISK_CACHE_STATS_HISTOGRAM_H_
6 #define NET_DISK_CACHE_STATS_HISTOGRAM_H_
10 #include "base/memory/scoped_ptr.h"
11 #include "base/metrics/histogram.h"
15 class HistogramSamples
;
19 namespace disk_cache
{
23 // This class provides support for sending the disk cache size stats as a UMA
24 // histogram. We'll provide our own storage and management for the data, and a
25 // SampleVector with a copy of our data.
27 // Class derivation of Histogram "deprecated," and should not be copied, and
28 // may eventually go away.
30 class StatsHistogram
: public base::Histogram
{
32 StatsHistogram(const std::string
& name
,
36 const base::BucketRanges
* ranges
,
38 virtual ~StatsHistogram();
40 static void InitializeBucketRanges(const Stats
* stats
,
41 base::BucketRanges
* ranges
);
42 static StatsHistogram
* FactoryGet(const std::string
& name
,
45 virtual scoped_ptr
<base::HistogramSamples
> SnapshotSamples() const OVERRIDE
;
46 virtual int FindCorruption(
47 const base::HistogramSamples
& samples
) const OVERRIDE
;
51 DISALLOW_COPY_AND_ASSIGN(StatsHistogram
);
54 } // namespace disk_cache
56 #endif // NET_DISK_CACHE_STATS_HISTOGRAM_H_