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

Unified Diff: base/metrics/histogram_base.h

Issue 11342060: Histogram type support in HistogramBase and remove SetRangeDescription function (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove "using" from metrics.cc Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/metrics/histogram.cc ('k') | base/metrics/histogram_base.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/metrics/histogram_base.h
diff --git a/base/metrics/histogram_base.h b/base/metrics/histogram_base.h
index 5e27e1e4bfe63bd289468288bd436f706384795a..302795a73fc7a4072bb4fc26ccb86461a5f790c0 100644
--- a/base/metrics/histogram_base.h
+++ b/base/metrics/histogram_base.h
@@ -14,9 +14,25 @@
namespace base {
class DictionaryValue;
+class HistogramSamples;
class ListValue;
-class HistogramSamples;
+////////////////////////////////////////////////////////////////////////////////
+// These enums are used to facilitate deserialization of histograms from other
+// processes into the browser. If you create another class that inherits from
+// HistogramBase, add new histogram types and names below.
+
+enum BASE_EXPORT HistogramType {
+ HISTOGRAM,
+ LINEAR_HISTOGRAM,
+ BOOLEAN_HISTOGRAM,
+ CUSTOM_HISTOGRAM,
+ SPARSE_HISTOGRAM,
+};
+
+std::string HistogramTypeToString(HistogramType type);
+
+////////////////////////////////////////////////////////////////////////////////
class BASE_EXPORT HistogramBase {
public:
@@ -40,7 +56,6 @@ class BASE_EXPORT HistogramBase {
kHexRangePrintingFlag = 0x8000,
};
-
HistogramBase(const std::string& name);
virtual ~HistogramBase();
@@ -51,6 +66,8 @@ class BASE_EXPORT HistogramBase {
void SetFlags(int32 flags);
void ClearFlags(int32 flags);
+ virtual HistogramType GetHistogramType() const = 0;
+
// Whether the histogram has construction arguments as parameters specified.
// For histograms that don't have the concept of minimum, maximum or
// bucket_count, this function always returns false.
« no previous file with comments | « base/metrics/histogram.cc ('k') | base/metrics/histogram_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698