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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/pc/rtcstatscollector_unittest.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 2016 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2016 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 1217 matching lines...) Expand 10 before | Expand all | Expand 10 after
1228 bool result = internal_record_.opened_data_channels.insert( 1228 bool result = internal_record_.opened_data_channels.insert(
1229 reinterpret_cast<uintptr_t>(channel)).second; 1229 reinterpret_cast<uintptr_t>(channel)).second;
1230 ++internal_record_.data_channels_opened; 1230 ++internal_record_.data_channels_opened;
1231 RTC_DCHECK(result); 1231 RTC_DCHECK(result);
1232 } 1232 }
1233 1233
1234 void RTCStatsCollector::OnDataChannelClosed(DataChannel* channel) { 1234 void RTCStatsCollector::OnDataChannelClosed(DataChannel* channel) {
1235 RTC_DCHECK(signaling_thread_->IsCurrent()); 1235 RTC_DCHECK(signaling_thread_->IsCurrent());
1236 // Only channels that have been fully opened (and have increased the 1236 // Only channels that have been fully opened (and have increased the
1237 // |data_channels_opened_| counter) increase the closed counter. 1237 // |data_channels_opened_| counter) increase the closed counter.
1238 if (internal_record_.opened_data_channels.find( 1238 if (internal_record_.opened_data_channels.erase(
1239 reinterpret_cast<uintptr_t>(channel)) != 1239 reinterpret_cast<uintptr_t>(channel))) {
1240 internal_record_.opened_data_channels.end()) {
1241 ++internal_record_.data_channels_closed; 1240 ++internal_record_.data_channels_closed;
1242 } 1241 }
1243 } 1242 }
1244 1243
1245 const char* CandidateTypeToRTCIceCandidateTypeForTesting( 1244 const char* CandidateTypeToRTCIceCandidateTypeForTesting(
1246 const std::string& type) { 1245 const std::string& type) {
1247 return CandidateTypeToRTCIceCandidateType(type); 1246 return CandidateTypeToRTCIceCandidateType(type);
1248 } 1247 }
1249 1248
1250 const char* DataStateToRTCDataChannelStateForTesting( 1249 const char* DataStateToRTCDataChannelStateForTesting(
1251 DataChannelInterface::DataState state) { 1250 DataChannelInterface::DataState state) {
1252 return DataStateToRTCDataChannelState(state); 1251 return DataStateToRTCDataChannelState(state);
1253 } 1252 }
1254 1253
1255 } // namespace webrtc 1254 } // namespace webrtc
OLDNEW
« 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