Index: base/metrics/histogram_base.h |
=================================================================== |
--- base/metrics/histogram_base.h (revision 251312) |
+++ base/metrics/histogram_base.h (working copy) |
@@ -12,6 +12,7 @@ |
#include "base/base_export.h" |
#include "base/basictypes.h" |
#include "base/memory/scoped_ptr.h" |
+#include "base/strings/string_piece.h" |
#include "base/time/time.h" |
class Pickle; |
@@ -48,8 +49,8 @@ |
class BASE_EXPORT HistogramBase { |
public: |
- typedef int Sample; // Used for samples. |
- typedef subtle::Atomic32 AtomicCount; // Used to count samples. |
+ typedef int Sample; // Used for samples. |
+ typedef subtle::Atomic32 AtomicCount; // Used to count samples. |
typedef int32 Count; // Used to manipulate counts in temporaries. |
static const Sample kSampleType_MAX; // INT_MAX |
@@ -92,6 +93,11 @@ |
std::string histogram_name() const { return histogram_name_; } |
+ // Comapres |name| to the histogram name and triggers a DCHECK if they do not |
+ // match. This is a helper function used by histogram macros, which results in |
+ // in more compact machine code being generated by the macros. |
+ void CheckName(const StringPiece& name) const; |
+ |
// Operations with Flags enum. |
int32 flags() const { return flags_; } |
void SetFlags(int32 flags); |
@@ -137,7 +143,7 @@ |
// customize the output. |
void WriteJSON(std::string* output) const; |
-protected: |
+ protected: |
// Subclasses should implement this function to make SerializeInfo work. |
virtual bool SerializeInfoImpl(Pickle* pickle) const = 0; |