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

Unified Diff: webrtc/pc/rtcstatscollector.cc

Issue 2746393003: RTCStatsCollector: Remove closed channels from opened set. (Closed)
Patch Set: Created 3 years, 9 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 | « no previous file | webrtc/pc/rtcstatscollector_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/pc/rtcstatscollector.cc
diff --git a/webrtc/pc/rtcstatscollector.cc b/webrtc/pc/rtcstatscollector.cc
index 347bca53ea01c459f66b59d48bd0616f5adef26f..d9da0729eda2275986ded8535f334a5816c82d4b 100644
--- a/webrtc/pc/rtcstatscollector.cc
+++ b/webrtc/pc/rtcstatscollector.cc
@@ -1235,9 +1235,8 @@ void RTCStatsCollector::OnDataChannelClosed(DataChannel* channel) {
RTC_DCHECK(signaling_thread_->IsCurrent());
// Only channels that have been fully opened (and have increased the
// |data_channels_opened_| counter) increase the closed counter.
- if (internal_record_.opened_data_channels.find(
- reinterpret_cast<uintptr_t>(channel)) !=
- internal_record_.opened_data_channels.end()) {
+ if (internal_record_.opened_data_channels.erase(
+ reinterpret_cast<uintptr_t>(channel))) {
++internal_record_.data_channels_closed;
}
}
« no previous file with comments | « no previous file | webrtc/pc/rtcstatscollector_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698