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

Side by Side Diff: net/disk_cache/blockfile/stats_histogram.h

Issue 295913014: Disk cache: Remove stats_histogram. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix typo Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/disk_cache/blockfile/stats.cc ('k') | net/disk_cache/blockfile/stats_histogram.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
5 #ifndef NET_DISK_CACHE_BLOCKFILE_STATS_HISTOGRAM_H_
6 #define NET_DISK_CACHE_BLOCKFILE_STATS_HISTOGRAM_H_
7
8 #include <string>
9
10 #include "base/memory/scoped_ptr.h"
11 #include "base/metrics/histogram.h"
12
13 namespace base {
14 class BucketRanges;
15 class HistogramSamples;
16 class SampleVector;
17 } // namespace base
18
19 namespace disk_cache {
20
21 class Stats;
22
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.
26 //
27 // Class derivation of Histogram "deprecated," and should not be copied, and
28 // may eventually go away.
29 //
30 class StatsHistogram : public base::Histogram {
31 public:
32 StatsHistogram(const std::string& name,
33 Sample minimum,
34 Sample maximum,
35 const base::BucketRanges* ranges,
36 const Stats* stats);
37 virtual ~StatsHistogram();
38
39 static void InitializeBucketRanges(const Stats* stats,
40 base::BucketRanges* ranges);
41 static StatsHistogram* FactoryGet(const std::string& name,
42 const Stats* stats);
43
44 // Disables this histogram when the underlying Stats go away.
45 void Disable();
46
47 virtual scoped_ptr<base::HistogramSamples> SnapshotSamples() const OVERRIDE;
48 virtual int FindCorruption(
49 const base::HistogramSamples& samples) const OVERRIDE;
50
51 private:
52 const Stats* stats_;
53 DISALLOW_COPY_AND_ASSIGN(StatsHistogram);
54 };
55
56 } // namespace disk_cache
57
58 #endif // NET_DISK_CACHE_BLOCKFILE_STATS_HISTOGRAM_H_
OLDNEW
« no previous file with comments | « net/disk_cache/blockfile/stats.cc ('k') | net/disk_cache/blockfile/stats_histogram.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698