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

Unified Diff: base/metrics/histogram_base.cc

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_base.h ('k') | base/metrics/sparse_histogram.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/metrics/histogram_base.cc
diff --git a/base/metrics/histogram_base.cc b/base/metrics/histogram_base.cc
index a5fade959eb41859d23133a132dc8f856bb6bf31..bcfb57feb231ce7be9b31bbf4eb34b0e8b441b0d 100644
--- a/base/metrics/histogram_base.cc
+++ b/base/metrics/histogram_base.cc
@@ -6,12 +6,31 @@
#include <climits>
+#include "base/logging.h"
#include "base/json/json_string_value_serializer.h"
#include "base/memory/scoped_ptr.h"
#include "base/values.h"
namespace base {
+std::string HistogramTypeToString(HistogramType type) {
+ switch(type) {
+ case HISTOGRAM:
+ return "HISTOGRAM";
+ case LINEAR_HISTOGRAM:
+ return "LINEAR_HISTOGRAM";
+ case BOOLEAN_HISTOGRAM:
+ return "BOOLEAN_HISTOGRAM";
+ case CUSTOM_HISTOGRAM:
+ return "CUSTOM_HISTOGRAM";
+ case SPARSE_HISTOGRAM:
+ return "SPARSE_HISTOGRAM";
+ default:
+ NOTREACHED();
+ }
+ return "UNKNOWN";
+}
+
const HistogramBase::Sample HistogramBase::kSampleType_MAX = INT_MAX;
HistogramBase::HistogramBase(const std::string& name)
« no previous file with comments | « base/metrics/histogram_base.h ('k') | base/metrics/sparse_histogram.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698