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); \ | 190 RTC_DCHECK_LE(index, 2u); \ |
191 RTC_DCHECK(index <= 2); \ | |
192 switch (index) { \ | 191 switch (index) { \ |
193 case 0: \ | 192 case 0: \ |
194 macro_invocation; \ | 193 macro_invocation; \ |
195 break; \ | 194 break; \ |
196 case 1: \ | 195 case 1: \ |
197 macro_invocation; \ | 196 macro_invocation; \ |
198 break; \ | 197 break; \ |
199 case 2: \ | 198 case 2: \ |
200 macro_invocation; \ | 199 macro_invocation; \ |
201 break; \ | 200 break; \ |
202 default: \ | 201 default: \ |
203 RTC_NOTREACHED(); \ | 202 RTC_NOTREACHED(); \ |
pbos-webrtc
2016/02/03 11:56:56
Maybe remove the DCHECK above and do RTC_NOTREACHE
åsapersson
2016/02/03 12:30:27
Removed the DCHECK.
| |
204 } \ | 203 } \ |
205 } while (0) | 204 } while (0) |
206 | 205 |
207 | 206 |
208 namespace webrtc { | 207 namespace webrtc { |
209 namespace metrics { | 208 namespace metrics { |
210 | 209 |
211 // Time that should have elapsed for stats that are gathered once per call. | 210 // Time that should have elapsed for stats that are gathered once per call. |
212 enum { kMinRunTimeInSeconds = 10 }; | 211 enum { kMinRunTimeInSeconds = 10 }; |
213 | 212 |
(...skipping 14 matching lines...) Expand all Loading... | |
228 // Function for adding a |sample| to a histogram. | 227 // Function for adding a |sample| to a histogram. |
229 // |name| can be used to verify that it matches the histogram name. | 228 // |name| can be used to verify that it matches the histogram name. |
230 void HistogramAdd( | 229 void HistogramAdd( |
231 Histogram* histogram_pointer, const std::string& name, int sample); | 230 Histogram* histogram_pointer, const std::string& name, int sample); |
232 | 231 |
233 } // namespace metrics | 232 } // namespace metrics |
234 } // namespace webrtc | 233 } // namespace webrtc |
235 | 234 |
236 #endif // WEBRTC_SYSTEM_WRAPPERS_INCLUDE_METRICS_H_ | 235 #endif // WEBRTC_SYSTEM_WRAPPERS_INCLUDE_METRICS_H_ |
237 | 236 |
OLD | NEW |