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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/BUILD.gn ('k') | webrtc/api/peerconnection.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/fakemetricsobserver.cc
diff --git a/webrtc/api/fakemetricsobserver.cc b/webrtc/api/fakemetricsobserver.cc
index 71e71b3432bacf719c88065cc9da8e72346e4596..1b6265d7d5676f9ad8b61a0e85cbcd24257bb9f8 100644
--- a/webrtc/api/fakemetricsobserver.cc
+++ b/webrtc/api/fakemetricsobserver.cc
@@ -45,7 +45,9 @@ void FakeMetricsObserver::AddHistogramSample(PeerConnectionMetricsName type,
int FakeMetricsObserver::GetEnumCounter(PeerConnectionEnumCounterType type,
int counter) const {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
- RTC_CHECK(counters_.size() > static_cast<size_t>(type));
+ if (counters_.size() <= static_cast<size_t>(type)) {
+ return 0;
+ }
const auto& it = counters_[type].find(counter);
if (it == counters_[type].end()) {
return 0;
« 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