Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(372)

Side by Side Diff: webrtc/system_wrappers/include/metrics.h

Issue 1564923008: Integrate helper macros for calling histograms with different names (real-time vs screenshare and r… (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « webrtc/modules/bitrate_controller/send_side_bandwidth_estimation.cc ('k') | webrtc/video/send_statistics_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698