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

Unified Diff: net/disk_cache/blockfile/histogram_macros_v3.h

Issue 196383016: Put histogram code in disk_cache on a diet. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Restored more code. Created 6 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 | « net/disk_cache/blockfile/histogram_macros.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/blockfile/histogram_macros_v3.h
diff --git a/net/disk_cache/blockfile/histogram_macros_v3.h b/net/disk_cache/blockfile/histogram_macros_v3.h
index e992a7c3f6950d6d8dfb82dfc39b2fa97e3371b3..16ccd063378419b930ff83fa3c8f1d3cf73f71c0 100644
--- a/net/disk_cache/blockfile/histogram_macros_v3.h
+++ b/net/disk_cache/blockfile/histogram_macros_v3.h
@@ -16,12 +16,10 @@
// These histograms follow the definition of UMA_HISTOGRAMN_XXX except that
// whenever the name changes (the experiment group changes), the histrogram
// object is re-created.
-// Note: These macros are only run on one thread, so the declarations of
-// |counter| was made static (i.e., there will be no race for reinitialization).
#define CACHE_HISTOGRAM_CUSTOM_COUNTS(name, sample, min, max, bucket_count) \
do { \
- static base::HistogramBase* counter(NULL); \
+ base::HistogramBase* counter(NULL); \
if (!counter || name != counter->histogram_name()) \
counter = base::Histogram::FactoryGet( \
name, min, max, bucket_count, \
@@ -40,7 +38,7 @@
#define CACHE_HISTOGRAM_CUSTOM_TIMES(name, sample, min, max, bucket_count) \
do { \
- static base::HistogramBase* counter(NULL); \
+ base::HistogramBase* counter(NULL); \
if (!counter || name != counter->histogram_name()) \
counter = base::Histogram::FactoryTimeGet( \
name, min, max, bucket_count, \
@@ -53,7 +51,7 @@
base::TimeDelta::FromSeconds(10), 50)
#define CACHE_HISTOGRAM_ENUMERATION(name, sample, boundary_value) do { \
- static base::HistogramBase* counter(NULL); \
+ base::HistogramBase* counter(NULL); \
if (!counter || name != counter->histogram_name()) \
counter = base::LinearHistogram::FactoryGet( \
name, 1, boundary_value, boundary_value + 1, \
@@ -97,17 +95,9 @@
CACHE_UMA_BACKEND_IMPL_OBJ->HistogramName(name);\
switch (CACHE_UMA_BACKEND_IMPL_OBJ->cache_type()) {\
case net::DISK_CACHE:\
- CACHE_HISTOGRAM_##type(my_name.data(), sample);\
- break;\
case net::MEDIA_CACHE:\
- CACHE_HISTOGRAM_##type(my_name.data(), sample);\
- break;\
case net::APP_CACHE:\
- CACHE_HISTOGRAM_##type(my_name.data(), sample);\
- break;\
case net::SHADER_CACHE:\
- CACHE_HISTOGRAM_##type(my_name.data(), sample);\
- break;\
case net::PNACL_CACHE:\
CACHE_HISTOGRAM_##type(my_name.data(), sample);\
break;\
« no previous file with comments | « net/disk_cache/blockfile/histogram_macros.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698