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

Side by Side Diff: webrtc/api/fakemetricsobserver.cc

Issue 2386783002: Add UMA metrics for ICE regathering reasons. (Closed)
Patch Set: Add const to the pooled_sessions method. Created 4 years, 2 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
« no previous file with comments | « webrtc/BUILD.gn ('k') | webrtc/api/peerconnection.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2015 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 27 matching lines...) Expand all
38 void FakeMetricsObserver::AddHistogramSample(PeerConnectionMetricsName type, 38 void FakeMetricsObserver::AddHistogramSample(PeerConnectionMetricsName type,
39 int value) { 39 int value) {
40 RTC_DCHECK(thread_checker_.CalledOnValidThread()); 40 RTC_DCHECK(thread_checker_.CalledOnValidThread());
41 RTC_DCHECK_EQ(histogram_samples_[type], 0); 41 RTC_DCHECK_EQ(histogram_samples_[type], 0);
42 histogram_samples_[type] = value; 42 histogram_samples_[type] = value;
43 } 43 }
44 44
45 int FakeMetricsObserver::GetEnumCounter(PeerConnectionEnumCounterType type, 45 int FakeMetricsObserver::GetEnumCounter(PeerConnectionEnumCounterType type,
46 int counter) const { 46 int counter) const {
47 RTC_DCHECK(thread_checker_.CalledOnValidThread()); 47 RTC_DCHECK(thread_checker_.CalledOnValidThread());
48 RTC_CHECK(counters_.size() > static_cast<size_t>(type)); 48 if (counters_.size() <= static_cast<size_t>(type)) {
49 return 0;
50 }
49 const auto& it = counters_[type].find(counter); 51 const auto& it = counters_[type].find(counter);
50 if (it == counters_[type].end()) { 52 if (it == counters_[type].end()) {
51 return 0; 53 return 0;
52 } 54 }
53 return it->second; 55 return it->second;
54 } 56 }
55 57
56 int FakeMetricsObserver::GetHistogramSample( 58 int FakeMetricsObserver::GetHistogramSample(
57 PeerConnectionMetricsName type) const { 59 PeerConnectionMetricsName type) const {
58 RTC_DCHECK(thread_checker_.CalledOnValidThread()); 60 RTC_DCHECK(thread_checker_.CalledOnValidThread());
59 return histogram_samples_[type]; 61 return histogram_samples_[type];
60 } 62 }
61 63
62 } // namespace webrtc 64 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/BUILD.gn ('k') | webrtc/api/peerconnection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698