| Index: net/disk_cache/blockfile/histogram_macros.h
|
| diff --git a/net/disk_cache/blockfile/histogram_macros.h b/net/disk_cache/blockfile/histogram_macros.h
|
| index a5d6f56f5c10ca888b78c97e5c4cb8ac6793d24b..ecffc8f0a4f6ca1d4d052d2472625bfa86b606a0 100644
|
| --- a/net/disk_cache/blockfile/histogram_macros.h
|
| +++ b/net/disk_cache/blockfile/histogram_macros.h
|
| @@ -14,16 +14,11 @@
|
| // -----------------------------------------------------------------------------
|
|
|
| // 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).
|
| +// the counter is not cached locally.
|
|
|
| #define CACHE_HISTOGRAM_CUSTOM_COUNTS(name, sample, min, max, bucket_count) \
|
| do { \
|
| - static base::HistogramBase* counter(NULL); \
|
| - if (!counter || name != counter->histogram_name()) \
|
| - counter = base::Histogram::FactoryGet( \
|
| + base::HistogramBase* counter = base::Histogram::FactoryGet( \
|
| name, min, max, bucket_count, \
|
| base::Histogram::kUmaTargetedHistogramFlag); \
|
| counter->Add(sample); \
|
| @@ -40,9 +35,7 @@
|
|
|
| #define CACHE_HISTOGRAM_CUSTOM_TIMES(name, sample, min, max, bucket_count) \
|
| do { \
|
| - static base::HistogramBase* counter(NULL); \
|
| - if (!counter || name != counter->histogram_name()) \
|
| - counter = base::Histogram::FactoryTimeGet( \
|
| + base::HistogramBase* counter = base::Histogram::FactoryTimeGet( \
|
| name, min, max, bucket_count, \
|
| base::Histogram::kUmaTargetedHistogramFlag); \
|
| counter->AddTime(sample); \
|
| @@ -53,9 +46,7 @@
|
| base::TimeDelta::FromSeconds(10), 50)
|
|
|
| #define CACHE_HISTOGRAM_ENUMERATION(name, sample, boundary_value) do { \
|
| - static base::HistogramBase* counter(NULL); \
|
| - if (!counter || name != counter->histogram_name()) \
|
| - counter = base::LinearHistogram::FactoryGet( \
|
| + base::HistogramBase* counter = base::LinearHistogram::FactoryGet( \
|
| name, 1, boundary_value, boundary_value + 1, \
|
| base::Histogram::kUmaTargetedHistogramFlag); \
|
| counter->Add(sample); \
|
| @@ -98,24 +89,16 @@
|
| const std::string my_name =\
|
| CACHE_UMA_BACKEND_IMPL_OBJ->HistogramName(name, experiment);\
|
| switch (CACHE_UMA_BACKEND_IMPL_OBJ->cache_type()) {\
|
| + default:\
|
| + NOTREACHED();\
|
| + /* Fall-through. */\
|
| 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;\
|
| - default:\
|
| - NOTREACHED();\
|
| - break;\
|
| }\
|
| }
|
|
|
|
|