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

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: 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
Index: base/metrics/histogram_base.h
diff --git a/base/metrics/histogram_base.h b/base/metrics/histogram_base.h
index 5e27e1e4bfe63bd289468288bd436f706384795a..ca1e9531a9e5a6179f5e982b0bdd7e5c69982b0c 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 inherits
Ilya Sherman 2012/10/31 00:35:19 nit: "class inherits" -> "class that inherits from
kaiwang 2012/10/31 01:12:56 Done.
+// HistogramBase, add new histogram types and names below.
+
+enum BASE_EXPORT HistogramType {
+ HISTOGRAM,
+ LINEAR_HISTOGRAM,
+ BOOLEAN_HISTOGRAM,
+ CUSTOM_HISTOGRAM,
+ SPARSE_HISTOGRAM,
+};
+
+std::string HistogramTypeName(HistogramType type);
Ilya Sherman 2012/10/31 00:35:19 Optional nit: Perhaps "HistogramTypeToString"?
kaiwang 2012/10/31 01:12:56 Done.
+
+////////////////////////////////////////////////////////////////////////////////
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.

Powered by Google App Engine
This is Rietveld 408576698