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

Unified Diff: base/metrics/histogram.h

Issue 2973863002: Remove std::string histogram name from HistogramBase object.
Patch Set: never rely on outside string permanence Created 3 years, 5 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') | base/metrics/histogram_base.cc » ('J')
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 6e5821d4680fd5d57dcfcbf4065d9a9a841b5e4d..47bffef695f14c62f51cda61d112c3d349b2995f 100644
--- a/base/metrics/histogram.h
+++ b/base/metrics/histogram.h
@@ -140,7 +140,7 @@ class BASE_EXPORT Histogram : public HistogramBase {
// Create a histogram using data in persistent storage.
static std::unique_ptr<HistogramBase> PersistentCreate(
- const std::string& name,
+ const char* name,
Sample minimum,
Sample maximum,
const BucketRanges* ranges,
@@ -217,7 +217,7 @@ class BASE_EXPORT Histogram : public HistogramBase {
// |ranges| should contain the underflow and overflow buckets. See top
// comments for example.
- Histogram(const std::string& name,
+ Histogram(const char* name,
Sample minimum,
Sample maximum,
const BucketRanges* ranges);
@@ -228,7 +228,7 @@ class BASE_EXPORT Histogram : public HistogramBase {
// the life of this memory is managed externally and exceeds the lifetime
// of this object. Practically, this memory is never released until the
// process exits and the OS cleans it up.
- Histogram(const std::string& name,
+ Histogram(const char* name,
Sample minimum,
Sample maximum,
const BucketRanges* ranges,
@@ -357,7 +357,7 @@ class BASE_EXPORT LinearHistogram : public Histogram {
// Create a histogram using data in persistent storage.
static std::unique_ptr<HistogramBase> PersistentCreate(
- const std::string& name,
+ const char* name,
Sample minimum,
Sample maximum,
const BucketRanges* ranges,
@@ -394,12 +394,12 @@ class BASE_EXPORT LinearHistogram : public Histogram {
protected:
class Factory;
- LinearHistogram(const std::string& name,
+ LinearHistogram(const char* name,
Sample minimum,
Sample maximum,
const BucketRanges* ranges);
- LinearHistogram(const std::string& name,
+ LinearHistogram(const char* name,
Sample minimum,
Sample maximum,
const BucketRanges* ranges,
@@ -446,7 +446,7 @@ class BASE_EXPORT BooleanHistogram : public LinearHistogram {
// Create a histogram using data in persistent storage.
static std::unique_ptr<HistogramBase> PersistentCreate(
- const std::string& name,
+ const char* name,
const BucketRanges* ranges,
const DelayedPersistentAllocation& counts,
const DelayedPersistentAllocation& logged_counts,
@@ -459,8 +459,8 @@ class BASE_EXPORT BooleanHistogram : public LinearHistogram {
class Factory;
private:
- BooleanHistogram(const std::string& name, const BucketRanges* ranges);
- BooleanHistogram(const std::string& name,
+ BooleanHistogram(const char* name, const BucketRanges* ranges);
+ BooleanHistogram(const char* name,
const BucketRanges* ranges,
const DelayedPersistentAllocation& counts,
const DelayedPersistentAllocation& logged_counts,
@@ -496,7 +496,7 @@ class BASE_EXPORT CustomHistogram : public Histogram {
// Create a histogram using data in persistent storage.
static std::unique_ptr<HistogramBase> PersistentCreate(
- const std::string& name,
+ const char* name,
const BucketRanges* ranges,
const DelayedPersistentAllocation& counts,
const DelayedPersistentAllocation& logged_counts,
@@ -517,10 +517,9 @@ class BASE_EXPORT CustomHistogram : public Histogram {
protected:
class Factory;
- CustomHistogram(const std::string& name,
- const BucketRanges* ranges);
+ CustomHistogram(const char* name, const BucketRanges* ranges);
- CustomHistogram(const std::string& name,
+ CustomHistogram(const char* name,
const BucketRanges* ranges,
const DelayedPersistentAllocation& counts,
const DelayedPersistentAllocation& logged_counts,
« no previous file with comments | « no previous file | base/metrics/histogram.cc » ('j') | base/metrics/histogram_base.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698