OLD | NEW |
1 // | 1 // |
2 // Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 // Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. |
3 // | 3 // |
4 // Use of this source code is governed by a BSD-style license | 4 // Use of this source code is governed by a BSD-style license |
5 // that can be found in the LICENSE file in the root of the source | 5 // that can be found in the LICENSE file in the root of the source |
6 // tree. An additional intellectual property rights grant can be found | 6 // tree. An additional intellectual property rights grant can be found |
7 // in the file PATENTS. All contributing project authors may | 7 // in the file PATENTS. All contributing project authors may |
8 // be found in the AUTHORS file in the root of the source tree. | 8 // be found in the AUTHORS file in the root of the source tree. |
9 // | 9 // |
10 | 10 |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 #define RTC_HISTOGRAMS_ENUMERATION(index, name, sample, boundary) \ | 180 #define RTC_HISTOGRAMS_ENUMERATION(index, name, sample, boundary) \ |
181 RTC_HISTOGRAMS_COMMON(index, name, sample, \ | 181 RTC_HISTOGRAMS_COMMON(index, name, sample, \ |
182 RTC_HISTOGRAM_ENUMERATION(name, sample, boundary)) | 182 RTC_HISTOGRAM_ENUMERATION(name, sample, boundary)) |
183 | 183 |
184 #define RTC_HISTOGRAMS_PERCENTAGE(index, name, sample) \ | 184 #define RTC_HISTOGRAMS_PERCENTAGE(index, name, sample) \ |
185 RTC_HISTOGRAMS_COMMON(index, name, sample, \ | 185 RTC_HISTOGRAMS_COMMON(index, name, sample, \ |
186 RTC_HISTOGRAM_PERCENTAGE(name, sample)) | 186 RTC_HISTOGRAM_PERCENTAGE(name, sample)) |
187 | 187 |
188 #define RTC_HISTOGRAMS_COMMON(index, name, sample, macro_invocation) \ | 188 #define RTC_HISTOGRAMS_COMMON(index, name, sample, macro_invocation) \ |
189 do { \ | 189 do { \ |
190 RTC_DCHECK(index >= 0); \ | |
191 RTC_DCHECK(index <= 2); \ | |
192 switch (index) { \ | 190 switch (index) { \ |
193 case 0: \ | 191 case 0: \ |
194 macro_invocation; \ | 192 macro_invocation; \ |
195 break; \ | 193 break; \ |
196 case 1: \ | 194 case 1: \ |
197 macro_invocation; \ | 195 macro_invocation; \ |
198 break; \ | 196 break; \ |
199 case 2: \ | 197 case 2: \ |
200 macro_invocation; \ | 198 macro_invocation; \ |
201 break; \ | 199 break; \ |
(...skipping 26 matching lines...) Expand all Loading... |
228 // Function for adding a |sample| to a histogram. | 226 // Function for adding a |sample| to a histogram. |
229 // |name| can be used to verify that it matches the histogram name. | 227 // |name| can be used to verify that it matches the histogram name. |
230 void HistogramAdd( | 228 void HistogramAdd( |
231 Histogram* histogram_pointer, const std::string& name, int sample); | 229 Histogram* histogram_pointer, const std::string& name, int sample); |
232 | 230 |
233 } // namespace metrics | 231 } // namespace metrics |
234 } // namespace webrtc | 232 } // namespace webrtc |
235 | 233 |
236 #endif // WEBRTC_SYSTEM_WRAPPERS_INCLUDE_METRICS_H_ | 234 #endif // WEBRTC_SYSTEM_WRAPPERS_INCLUDE_METRICS_H_ |
237 | 235 |
OLD | NEW |