Chromium Code Reviews| 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..e6fdef3c0eda9f08982596fe5f9a259aa7b1a514 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, \ |
| @@ -96,23 +94,16 @@ |
| const std::string my_name =\ |
| CACHE_UMA_BACKEND_IMPL_OBJ->HistogramName(name);\ |
| switch (CACHE_UMA_BACKEND_IMPL_OBJ->cache_type()) {\ |
| + default:\ |
| + NOTREACHED();\ |
|
rvargas (doing something else)
2014/03/17 19:41:00
Don't add a NOTREACHED here... I'm going with no h
|
| + /* 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:\ |
| - break;\ |
| }\ |
| } |