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

Unified Diff: webkit/glue/webkitclient_impl.cc

Issue 6780035: Use lock-free lazy initialization for static histogram references (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/valgrind/memcheck/suppressions.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/webkitclient_impl.cc
===================================================================
--- webkit/glue/webkitclient_impl.cc (revision 80382)
+++ webkit/glue/webkitclient_impl.cc (working copy)
@@ -264,24 +264,22 @@
const char* name, int sample, int min, int max, int bucket_count) {
// Copied from histogram macro, but without the static variable caching
// the histogram because name is dynamic.
- scoped_refptr<base::Histogram> counter =
+ base::Histogram* counter =
base::Histogram::FactoryGet(name, min, max, bucket_count,
base::Histogram::kUmaTargetedHistogramFlag);
DCHECK_EQ(name, counter->histogram_name());
- if (counter.get())
- counter->Add(sample);
+ counter->Add(sample);
}
void WebKitClientImpl::histogramEnumeration(
const char* name, int sample, int boundary_value) {
// Copied from histogram macro, but without the static variable caching
// the histogram because name is dynamic.
- scoped_refptr<base::Histogram> counter =
+ base::Histogram* counter =
base::LinearHistogram::FactoryGet(name, 1, boundary_value,
boundary_value + 1, base::Histogram::kUmaTargetedHistogramFlag);
DCHECK_EQ(name, counter->histogram_name());
- if (counter.get())
- counter->Add(sample);
+ counter->Add(sample);
}
void WebKitClientImpl::traceEventBegin(const char* name, void* id,
« no previous file with comments | « tools/valgrind/memcheck/suppressions.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698