From a764bf5e513ff576f538c34b9ece9df1570e999c Mon Sep 17 00:00:00 2001 From: "ziadh@chromium.org" Date: Wed, 2 Jun 2010 21:31:44 +0000 Subject: Refactored Histogram::FactoryGet() to be style-compliant Currently, two (2) overloaded versions of Histogram::FactoryGet() exist. Google's C++ style guide discourages such implementations. I refactored the methods into Histogram::FactoryGet() (no name change), which takes 'Sample' types as arguments, and Histogram::FactoryTimeGet(), which takes base::TimeDelta types as arguments. r = jar Review URL: http://codereview.chromium.org/2423004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48766 0039d316-1c4b-4281-b951-d872f2087c98 --- base/histogram.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'base/histogram.h') diff --git a/base/histogram.h b/base/histogram.h index f4cb16e..edcb629 100644 --- a/base/histogram.h +++ b/base/histogram.h @@ -70,7 +70,7 @@ // For folks that need real specific times, use this to select a precise range // of times you want plotted, and the number of buckets you want used. #define HISTOGRAM_CUSTOM_TIMES(name, sample, min, max, bucket_count) do { \ - static scoped_refptr counter = Histogram::FactoryGet( \ + static scoped_refptr counter = Histogram::FactoryTimeGet( \ name, min, max, bucket_count, Histogram::kNoFlags); \ DCHECK_EQ(name, counter->histogram_name()); \ counter->AddTime(sample); \ @@ -78,7 +78,7 @@ // DO NOT USE THIS. It is being phased out, in favor of HISTOGRAM_CUSTOM_TIMES. #define HISTOGRAM_CLIPPED_TIMES(name, sample, min, max, bucket_count) do { \ - static scoped_refptr counter = Histogram::FactoryGet( \ + static scoped_refptr counter = Histogram::FactoryTimeGet( \ name, min, max, bucket_count, Histogram::kNoFlags); \ DCHECK_EQ(name, counter->histogram_name()); \ if ((sample) < (max)) counter->AddTime(sample); \ @@ -158,7 +158,7 @@ base::TimeDelta::FromHours(1), 50) #define UMA_HISTOGRAM_CUSTOM_TIMES(name, sample, min, max, bucket_count) do { \ - static scoped_refptr counter = Histogram::FactoryGet( \ + static scoped_refptr counter = Histogram::FactoryTimeGet( \ name, min, max, bucket_count, Histogram::kUmaTargetedHistogramFlag); \ DCHECK_EQ(name, counter->histogram_name()); \ counter->AddTime(sample); \ @@ -166,7 +166,7 @@ // DO NOT USE THIS. It is being phased out, in favor of HISTOGRAM_CUSTOM_TIMES. #define UMA_HISTOGRAM_CLIPPED_TIMES(name, sample, min, max, bucket_count) do { \ - static scoped_refptr counter = Histogram::FactoryGet( \ + static scoped_refptr counter = Histogram::FactoryTimeGet( \ name, min, max, bucket_count, Histogram::kUmaTargetedHistogramFlag); \ DCHECK_EQ(name, counter->histogram_name()); \ if ((sample) < (max)) counter->AddTime(sample); \ @@ -310,7 +310,7 @@ class Histogram : public base::RefCountedThreadSafe { // default underflow bucket. static scoped_refptr FactoryGet(const std::string& name, Sample minimum, Sample maximum, size_t bucket_count, Flags flags); - static scoped_refptr FactoryGet(const std::string& name, + static scoped_refptr FactoryTimeGet(const std::string& name, base::TimeDelta minimum, base::TimeDelta maximum, size_t bucket_count, Flags flags); -- cgit v1.1