From 2753b39e0c2e83d3b497ebadc2d720f12b74db40 Mon Sep 17 00:00:00 2001 From: "jar@chromium.org" Date: Mon, 28 Dec 2009 06:59:52 +0000 Subject: Cleanup histogram classes mixing SetFlags into FactoryGet arguments Generic cleanup of histogram class, renaming *FactoryGet to FactoryGet, along with reformatting. The macros were cleaned up to use common sub-macros rather than repeating code as much. Removed ThreadSafeHistogram (and associated ASSET_HISTOGRAM macros) since this class was not getting used. I introduced UMA_HISTOGRAM_ENUMERATION to support the common use of LinearHistograms to count various enumerated values. I added a Flags argument to all the FactoryGet routines to help avoid needing to call SetFlags each time a new sample is Add()ed. This also simplifies the code. This will all help prepare for a "don't histogram at all" macro setting so that I can test the impact of the histogram macro calls on performance (since there are now so many active histograms). BUG=31206 r=raman.tenneti Review URL: http://codereview.chromium.org/515033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35295 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/renderer/render_thread.cc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'chrome/renderer') diff --git a/chrome/renderer/render_thread.cc b/chrome/renderer/render_thread.cc index d1ce79d..632adab 100644 --- a/chrome/renderer/render_thread.cc +++ b/chrome/renderer/render_thread.cc @@ -505,13 +505,11 @@ static void* CreateHistogram( const char *name, int min, int max, size_t buckets) { if (min <= 0) min = 1; - scoped_refptr histogram = - Histogram::HistogramFactoryGet(name, min, max, buckets); - // We verify this was not being destructed by setting a novel "PlannedLeak" - // flag and watching out for the flag in the destructor. - histogram->SetFlags(kUmaTargetedHistogramFlag | kPlannedLeakFlag); + scoped_refptr histogram = Histogram::FactoryGet( + name, min, max, buckets, Histogram::kUmaTargetedHistogramFlag); // We'll end up leaking these histograms, unless there is some code hiding in // there to do the dec-ref. + // TODO(jar): Handle reference counting in webkit glue. histogram->AddRef(); return histogram.get(); } -- cgit v1.1