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

Side by Side Diff: base/metrics/histogram_base.h

Issue 1181293005: Optimize memory use of registered histograms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Improve comments. 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 unified diff | Download patch
« no previous file with comments | « no previous file | base/metrics/statistics_recorder.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef BASE_METRICS_HISTOGRAM_BASE_H_ 5 #ifndef BASE_METRICS_HISTOGRAM_BASE_H_
6 #define BASE_METRICS_HISTOGRAM_BASE_H_ 6 #define BASE_METRICS_HISTOGRAM_BASE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 BUCKET_ORDER_ERROR = 0x2, 85 BUCKET_ORDER_ERROR = 0x2,
86 COUNT_HIGH_ERROR = 0x4, 86 COUNT_HIGH_ERROR = 0x4,
87 COUNT_LOW_ERROR = 0x8, 87 COUNT_LOW_ERROR = 0x8,
88 88
89 NEVER_EXCEEDED_VALUE = 0x10 89 NEVER_EXCEEDED_VALUE = 0x10
90 }; 90 };
91 91
92 explicit HistogramBase(const std::string& name); 92 explicit HistogramBase(const std::string& name);
93 virtual ~HistogramBase(); 93 virtual ~HistogramBase();
94 94
95 std::string histogram_name() const { return histogram_name_; } 95 const std::string& histogram_name() const { return histogram_name_; }
96 96
97 // Comapres |name| to the histogram name and triggers a DCHECK if they do not 97 // Comapres |name| to the histogram name and triggers a DCHECK if they do not
98 // match. This is a helper function used by histogram macros, which results in 98 // match. This is a helper function used by histogram macros, which results in
99 // in more compact machine code being generated by the macros. 99 // in more compact machine code being generated by the macros.
100 void CheckName(const StringPiece& name) const; 100 void CheckName(const StringPiece& name) const;
101 101
102 // Operations with Flags enum. 102 // Operations with Flags enum.
103 int32_t flags() const { return flags_; } 103 int32_t flags() const { return flags_; }
104 void SetFlags(int32_t flags); 104 void SetFlags(int32_t flags);
105 void ClearFlags(int32_t flags); 105 void ClearFlags(int32_t flags);
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 private: 175 private:
176 const std::string histogram_name_; 176 const std::string histogram_name_;
177 int32_t flags_; 177 int32_t flags_;
178 178
179 DISALLOW_COPY_AND_ASSIGN(HistogramBase); 179 DISALLOW_COPY_AND_ASSIGN(HistogramBase);
180 }; 180 };
181 181
182 } // namespace base 182 } // namespace base
183 183
184 #endif // BASE_METRICS_HISTOGRAM_BASE_H_ 184 #endif // BASE_METRICS_HISTOGRAM_BASE_H_
OLDNEW
« no previous file with comments | « no previous file | base/metrics/statistics_recorder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698