| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // This file contains macros to simplify histogram reporting from the disk | 5 // This file contains macros to simplify histogram reporting from the disk |
| 6 // cache. The main issue is that we want to have separate histograms for each | 6 // cache. The main issue is that we want to have separate histograms for each |
| 7 // type of cache (regular vs. media, etc), without adding the complexity of | 7 // type of cache (regular vs. media, etc), without adding the complexity of |
| 8 // keeping track of a potentially large number of histogram objects that have to | 8 // keeping track of a potentially large number of histogram objects that have to |
| 9 // survive the backend object that created them. | 9 // survive the backend object that created them. |
| 10 | 10 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 // | 49 // |
| 50 #define CACHE_UMA(type, name, experiment, sample) {\ | 50 #define CACHE_UMA(type, name, experiment, sample) {\ |
| 51 const std::string my_name = BACKEND_OBJ->HistogramName(name, experiment);\ | 51 const std::string my_name = BACKEND_OBJ->HistogramName(name, experiment);\ |
| 52 switch (BACKEND_OBJ->cache_type()) {\ | 52 switch (BACKEND_OBJ->cache_type()) {\ |
| 53 case net::DISK_CACHE:\ | 53 case net::DISK_CACHE:\ |
| 54 UMA_HISTOGRAM_##type(my_name.data(), sample);\ | 54 UMA_HISTOGRAM_##type(my_name.data(), sample);\ |
| 55 break;\ | 55 break;\ |
| 56 case net::MEDIA_CACHE:\ | 56 case net::MEDIA_CACHE:\ |
| 57 UMA_HISTOGRAM_##type(my_name.data(), sample);\ | 57 UMA_HISTOGRAM_##type(my_name.data(), sample);\ |
| 58 break;\ | 58 break;\ |
| 59 case net::TEMP_MEDIA_CACHE:\ | |
| 60 UMA_HISTOGRAM_##type(my_name.data(), sample);\ | |
| 61 break;\ | |
| 62 default:\ | 59 default:\ |
| 63 NOTREACHED();\ | 60 NOTREACHED();\ |
| 64 break;\ | 61 break;\ |
| 65 }\ | 62 }\ |
| 66 } | 63 } |
| 67 | 64 |
| 68 #endif // NET_DISK_CACHE_HISTOGRAM_MACROS_H_ | 65 #endif // NET_DISK_CACHE_HISTOGRAM_MACROS_H_ |
| OLD | NEW |