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

Unified Diff: base/metrics/histogram.h

Issue 1195473002: Optimize size of UMA histogram macros. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/metrics/histogram.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/metrics/histogram.h
diff --git a/base/metrics/histogram.h b/base/metrics/histogram.h
index c13f05e17904ce7461ffcb7106ef1cac8f3bbfd2..58bc0297aba45c9838fe22ed8949880288c7edea 100644
--- a/base/metrics/histogram.h
+++ b/base/metrics/histogram.h
@@ -121,6 +121,20 @@ class BASE_EXPORT Histogram : public HistogramBase {
size_t bucket_count,
int32 flags);
+ // Overloads of the above two functions that take a const char* |name| param,
+ // to avoid code bloat from the std::string constructor being inlined into
+ // call sites.
+ static HistogramBase* FactoryGet(const char* name,
+ Sample minimum,
+ Sample maximum,
+ size_t bucket_count,
+ int32 flags);
+ static HistogramBase* FactoryTimeGet(const char* name,
+ base::TimeDelta minimum,
+ base::TimeDelta maximum,
+ size_t bucket_count,
+ int32 flags);
+
static void InitializeBucketRanges(Sample minimum,
Sample maximum,
BucketRanges* ranges);
@@ -277,6 +291,20 @@ class BASE_EXPORT LinearHistogram : public Histogram {
size_t bucket_count,
int32 flags);
+ // Overloads of the above two functions that take a const char* |name| param,
+ // to avoid code bloat from the std::string constructor being inlined into
+ // call sites.
+ static HistogramBase* FactoryGet(const char* name,
+ Sample minimum,
+ Sample maximum,
+ size_t bucket_count,
+ int32 flags);
+ static HistogramBase* FactoryTimeGet(const char* name,
+ TimeDelta minimum,
+ TimeDelta maximum,
+ size_t bucket_count,
+ int32 flags);
+
struct DescriptionPair {
Sample sample;
const char* description; // Null means end of a list of pairs.
@@ -339,6 +367,11 @@ class BASE_EXPORT BooleanHistogram : public LinearHistogram {
public:
static HistogramBase* FactoryGet(const std::string& name, int32 flags);
+ // Overload of the above function that takes a const char* |name| param,
+ // to avoid code bloat from the std::string constructor being inlined into
+ // call sites.
+ static HistogramBase* FactoryGet(const char* name, int32 flags);
+
HistogramType GetHistogramType() const override;
private:
@@ -364,6 +397,13 @@ class BASE_EXPORT CustomHistogram : public Histogram {
const std::vector<Sample>& custom_ranges,
int32 flags);
+ // Overload of the above function that takes a const char* |name| param,
+ // to avoid code bloat from the std::string constructor being inlined into
+ // call sites.
+ static HistogramBase* FactoryGet(const char* name,
+ const std::vector<Sample>& custom_ranges,
+ int32 flags);
+
// Overridden from Histogram:
HistogramType GetHistogramType() const override;
« no previous file with comments | « no previous file | base/metrics/histogram.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698