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

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

Issue 2472113002: Correct stats for RTCPeerConnectionStats.dataChannels[Opened/Closed]. (Closed)
Patch Set: Created 4 years, 1 month 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 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2012 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 2061 matching lines...) Expand 10 before | Expand all | Expand 10 after
2072 return nullptr; 2072 return nullptr;
2073 } 2073 }
2074 } 2074 }
2075 2075
2076 rtc::scoped_refptr<DataChannel> channel(DataChannel::Create( 2076 rtc::scoped_refptr<DataChannel> channel(DataChannel::Create(
2077 session_.get(), session_->data_channel_type(), label, new_config)); 2077 session_.get(), session_->data_channel_type(), label, new_config));
2078 if (!channel) { 2078 if (!channel) {
2079 sid_allocator_.ReleaseSid(new_config.id); 2079 sid_allocator_.ReleaseSid(new_config.id);
2080 return nullptr; 2080 return nullptr;
2081 } 2081 }
2082 channel->SignalOpened.connect(stats_collector_.get(),
2083 &RTCStatsCollector::OnDataChannelOpened);
2084 channel->SignalOpened.connect(stats_collector_.get(),
2085 &RTCStatsCollector::OnDataChannelClosed);
2082 2086
2083 if (channel->data_channel_type() == cricket::DCT_RTP) { 2087 if (channel->data_channel_type() == cricket::DCT_RTP) {
2084 if (rtp_data_channels_.find(channel->label()) != rtp_data_channels_.end()) { 2088 if (rtp_data_channels_.find(channel->label()) != rtp_data_channels_.end()) {
2085 LOG(LS_ERROR) << "DataChannel with label " << channel->label() 2089 LOG(LS_ERROR) << "DataChannel with label " << channel->label()
2086 << " already exists."; 2090 << " already exists.";
2087 return nullptr; 2091 return nullptr;
2088 } 2092 }
2089 rtp_data_channels_[channel->label()] = channel; 2093 rtp_data_channels_[channel->label()] = channel;
2090 } else { 2094 } else {
2091 RTC_DCHECK(channel->data_channel_type() == cricket::DCT_SCTP); 2095 RTC_DCHECK(channel->data_channel_type() == cricket::DCT_SCTP);
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
2341 2345
2342 bool PeerConnection::StartRtcEventLog_w(rtc::PlatformFile file, 2346 bool PeerConnection::StartRtcEventLog_w(rtc::PlatformFile file,
2343 int64_t max_size_bytes) { 2347 int64_t max_size_bytes) {
2344 return event_log_->StartLogging(file, max_size_bytes); 2348 return event_log_->StartLogging(file, max_size_bytes);
2345 } 2349 }
2346 2350
2347 void PeerConnection::StopRtcEventLog_w() { 2351 void PeerConnection::StopRtcEventLog_w() {
2348 event_log_->StopLogging(); 2352 event_log_->StopLogging();
2349 } 2353 }
2350 } // namespace webrtc 2354 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698