| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_HISTOGRAM_MACROS_H_ |
| 6 #define CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_HISTOGRAM_MACROS_H_ |
| 7 |
| 8 #include "base/metrics/histogram_macros.h" |
| 9 #include "content/browser/cache_storage/cache_storage_scheduler_client.h" |
| 10 |
| 11 namespace content { |
| 12 |
| 13 // Metrics to make it easier to write histograms for several clients. |
| 14 #define CACHE_STORAGE_SCHEDULER_UMA_THUNK(uma_type, args) \ |
| 15 UMA_HISTOGRAM_##uma_type args |
| 16 #define CACHE_STORAGE_SCHEDULER_UMA(uma_type, uma_name, client_type, ...) \ |
| 17 do { \ |
| 18 switch (client_type) { \ |
| 19 case CacheStorageSchedulerClient::CLIENT_STORAGE: \ |
| 20 CACHE_STORAGE_SCHEDULER_UMA_THUNK( \ |
| 21 uma_type, ("ServiceWorkerCache.CacheStorage.Scheduler." uma_name, \ |
| 22 ##__VA_ARGS__)); \ |
| 23 break; \ |
| 24 case CacheStorageSchedulerClient::CLIENT_CACHE: \ |
| 25 CACHE_STORAGE_SCHEDULER_UMA_THUNK( \ |
| 26 uma_type, \ |
| 27 ("ServiceWorkerCache.Cache.Scheduler." uma_name, ##__VA_ARGS__)); \ |
| 28 break; \ |
| 29 case CacheStorageSchedulerClient::CLIENT_BACKGROUND_SYNC: \ |
| 30 CACHE_STORAGE_SCHEDULER_UMA_THUNK( \ |
| 31 uma_type, \ |
| 32 ("ServiceWorkerCache.BackgroundSyncManager.Scheduler." uma_name, \ |
| 33 ##__VA_ARGS__)); \ |
| 34 break; \ |
| 35 default: \ |
| 36 NOTREACHED(); \ |
| 37 break; \ |
| 38 } \ |
| 39 } while (0) |
| 40 |
| 41 } // namespace content |
| 42 |
| 43 #endif // CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_HISTOGRAM_MACROS_H_ |
| OLD | NEW |