| Index: cc/base/histograms.h
|
| diff --git a/cc/base/histograms.h b/cc/base/histograms.h
|
| index 6614f73ef65307980a473af448a36f00c93ac201..a4c0c58cc90ee36dbe70605d6be194af06a2f7e8 100644
|
| --- a/cc/base/histograms.h
|
| +++ b/cc/base/histograms.h
|
| @@ -50,14 +50,14 @@ const char* GetClientNameForMetrics();
|
| //
|
| #define DEFINE_SCOPED_UMA_HISTOGRAM_AREA_TIMER(class_name, time_histogram, \
|
| area_histogram) \
|
| - class class_name : public ::cc::ScopedUMAHistogramAreaTimerBase { \
|
| + class class_name : public ScopedUMAHistogramAreaTimerBase { \
|
| public: \
|
| ~class_name(); \
|
| }; \
|
| class_name::~class_name() { \
|
| Sample time_sample; \
|
| Sample area_sample; \
|
| - const char* client_name = ::cc::GetClientNameForMetrics(); \
|
| + const char* client_name = GetClientNameForMetrics(); \
|
| if (client_name && GetHistogramValues(&time_sample, &area_sample)) { \
|
| /* GetClientNameForMetrics only returns one non-null value over */ \
|
| /* the lifetime of the process, so these histogram names are */ \
|
| @@ -69,6 +69,26 @@ const char* GetClientNameForMetrics();
|
| } \
|
| }
|
|
|
| +// Version of the above macro for cases which only care about time, not area.
|
| +#define DEFINE_SCOPED_UMA_HISTOGRAM_TIMER(class_name, time_histogram) \
|
| + class class_name : public ScopedUMAHistogramAreaTimerBase { \
|
| + public: \
|
| + ~class_name(); \
|
| + }; \
|
| + class_name::~class_name() { \
|
| + Sample time_sample; \
|
| + Sample area_sample; \
|
| + const char* client_name = GetClientNameForMetrics(); \
|
| + if (client_name && GetHistogramValues(&time_sample, &area_sample)) { \
|
| + DCHECK_EQ(0, area_sample); \
|
| + /* GetClientNameForMetrics only returns one non-null value over */ \
|
| + /* the lifetime of the process, so these histogram names are */ \
|
| + /* runtime constant. */ \
|
| + UMA_HISTOGRAM_COUNTS(base::StringPrintf(time_histogram, client_name), \
|
| + time_sample); \
|
| + } \
|
| + }
|
| +
|
| class CC_EXPORT ScopedUMAHistogramAreaTimerBase {
|
| public:
|
| void AddArea(const base::CheckedNumeric<int>& area) { area_ += area; }
|
|
|