| 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..ac5474ac4a1251b6b0d9bc0d285a0bec51fcc704 100644
|
| --- a/net/disk_cache/blockfile/histogram_macros.h
|
| +++ b/net/disk_cache/blockfile/histogram_macros.h
|
| @@ -14,16 +14,16 @@
|
| // -----------------------------------------------------------------------------
|
|
|
| // 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.
|
| +// the counter is not cached locally.
|
| // 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).
|
| +// |counter| could be static (since there will be no race for reinitialization),
|
| +// but as they are used (with new names every time) in CACHE_UMA that
|
| +// would not work and if CACHE_UMA is made to have one instance for every
|
| +// cache, they will generate too much non-reusable machine code.
|
|
|
| #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 +40,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 +51,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); \
|
| @@ -97,26 +93,7 @@
|
| #define CACHE_UMA(type, name, experiment, sample) {\
|
| const std::string my_name =\
|
| CACHE_UMA_BACKEND_IMPL_OBJ->HistogramName(name, experiment);\
|
| - 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;\
|
| - default:\
|
| - NOTREACHED();\
|
| - break;\
|
| - }\
|
| + CACHE_HISTOGRAM_##type(my_name.data(), sample);\
|
| }
|
|
|
| #endif // NET_DISK_CACHE_BLOCKFILE_HISTOGRAM_MACROS_H_
|
|
|