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

Unified Diff: net/disk_cache/stats_histogram.h

Issue 462027: Use factory to create histograms, and refcounts to track lifetimes... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/disk_cache/stats.cc ('k') | net/disk_cache/stats_histogram.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/stats_histogram.h
===================================================================
--- net/disk_cache/stats_histogram.h (revision 33932)
+++ net/disk_cache/stats_histogram.h (working copy)
@@ -5,6 +5,8 @@
#ifndef NET_DISK_CACHE_STATS_HISTOGRAM_H_
#define NET_DISK_CACHE_STATS_HISTOGRAM_H_
+#include <string>
+
#include "base/histogram.h"
namespace disk_cache {
@@ -14,6 +16,10 @@
// This class provides support for sending the disk cache size stats as a UMA
// histogram. We'll provide our own storage and management for the data, and a
// SampleSet with a copy of our data.
+//
+// Class derivation of Histogram "deprecated," and should not be copied, and
+// may eventually go away.
+//
class StatsHistogram : public Histogram {
public:
class StatsSamples : public SampleSet {
@@ -23,10 +29,14 @@
}
};
- explicit StatsHistogram(const char* name)
- : Histogram(name, 1, 1, 2), init_(false) {}
+ explicit StatsHistogram(const std::string& name, Sample minimum,
+ Sample maximum, size_t bucket_count)
+ : Histogram(name, minimum, maximum, bucket_count), init_(false) {}
~StatsHistogram();
+ static scoped_refptr<StatsHistogram>
+ StatsHistogramFactoryGet(const std::string& name);
+
// We'll be reporting data from the given set of cache stats.
bool Init(const Stats* stats);
@@ -35,6 +45,8 @@
virtual void SnapshotSample(SampleSet* sample) const;
private:
+ friend class Histogram;
+
bool init_;
static const Stats* stats_;
DISALLOW_COPY_AND_ASSIGN(StatsHistogram);
« no previous file with comments | « net/disk_cache/stats.cc ('k') | net/disk_cache/stats_histogram.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698