| OLD | NEW |
| 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 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 624 if (options.disable_encryption) { | 624 if (options.disable_encryption) { |
| 625 webrtc_session_desc_factory_->SetSdesPolicy(cricket::SEC_DISABLED); | 625 webrtc_session_desc_factory_->SetSdesPolicy(cricket::SEC_DISABLED); |
| 626 } | 626 } |
| 627 | 627 |
| 628 return true; | 628 return true; |
| 629 } | 629 } |
| 630 | 630 |
| 631 void WebRtcSession::Close() { | 631 void WebRtcSession::Close() { |
| 632 SetState(STATE_CLOSED); | 632 SetState(STATE_CLOSED); |
| 633 RemoveUnusedChannels(nullptr); | 633 RemoveUnusedChannels(nullptr); |
| 634 call_ = nullptr; |
| 634 RTC_DCHECK(!voice_channel_); | 635 RTC_DCHECK(!voice_channel_); |
| 635 RTC_DCHECK(!video_channel_); | 636 RTC_DCHECK(!video_channel_); |
| 636 RTC_DCHECK(!rtp_data_channel_); | 637 RTC_DCHECK(!rtp_data_channel_); |
| 637 RTC_DCHECK(!sctp_transport_); | 638 RTC_DCHECK(!sctp_transport_); |
| 638 } | 639 } |
| 639 | 640 |
| 640 cricket::BaseChannel* WebRtcSession::GetChannel( | 641 cricket::BaseChannel* WebRtcSession::GetChannel( |
| 641 const std::string& content_name) { | 642 const std::string& content_name) { |
| 642 if (voice_channel() && voice_channel()->content_name() == content_name) { | 643 if (voice_channel() && voice_channel()->content_name() == content_name) { |
| 643 return voice_channel(); | 644 return voice_channel(); |
| (...skipping 1244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1888 this, &WebRtcSession::OnDtlsSrtpSetupFailure); | 1889 this, &WebRtcSession::OnDtlsSrtpSetupFailure); |
| 1889 rtp_data_channel_->SignalSentPacket.connect(this, | 1890 rtp_data_channel_->SignalSentPacket.connect(this, |
| 1890 &WebRtcSession::OnSentPacket_w); | 1891 &WebRtcSession::OnSentPacket_w); |
| 1891 } | 1892 } |
| 1892 | 1893 |
| 1893 SignalDataChannelCreated(); | 1894 SignalDataChannelCreated(); |
| 1894 | 1895 |
| 1895 return true; | 1896 return true; |
| 1896 } | 1897 } |
| 1897 | 1898 |
| 1899 Call::Stats WebRtcSession::GetCallStats() { |
| 1900 if (!worker_thread()->IsCurrent()) { |
| 1901 return worker_thread()->Invoke<Call::Stats>( |
| 1902 RTC_FROM_HERE, rtc::Bind(&WebRtcSession::GetCallStats, this)); |
| 1903 } |
| 1904 RTC_DCHECK(call_); |
| 1905 return call_->GetStats(); |
| 1906 } |
| 1907 |
| 1898 std::unique_ptr<SessionStats> WebRtcSession::GetStats_n( | 1908 std::unique_ptr<SessionStats> WebRtcSession::GetStats_n( |
| 1899 const ChannelNamePairs& channel_name_pairs) { | 1909 const ChannelNamePairs& channel_name_pairs) { |
| 1900 RTC_DCHECK(network_thread()->IsCurrent()); | 1910 RTC_DCHECK(network_thread()->IsCurrent()); |
| 1901 std::unique_ptr<SessionStats> session_stats(new SessionStats()); | 1911 std::unique_ptr<SessionStats> session_stats(new SessionStats()); |
| 1902 for (const auto channel_name_pair : { &channel_name_pairs.voice, | 1912 for (const auto channel_name_pair : { &channel_name_pairs.voice, |
| 1903 &channel_name_pairs.video, | 1913 &channel_name_pairs.video, |
| 1904 &channel_name_pairs.data }) { | 1914 &channel_name_pairs.data }) { |
| 1905 if (*channel_name_pair) { | 1915 if (*channel_name_pair) { |
| 1906 cricket::TransportStats transport_stats; | 1916 cricket::TransportStats transport_stats; |
| 1907 if (!transport_controller_->GetStats((*channel_name_pair)->transport_name, | 1917 if (!transport_controller_->GetStats((*channel_name_pair)->transport_name, |
| (...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2310 srtp_crypto_suite); | 2320 srtp_crypto_suite); |
| 2311 } | 2321 } |
| 2312 if (ssl_cipher_suite != rtc::TLS_NULL_WITH_NULL_NULL) { | 2322 if (ssl_cipher_suite != rtc::TLS_NULL_WITH_NULL_NULL) { |
| 2313 metrics_observer_->IncrementSparseEnumCounter(ssl_counter_type, | 2323 metrics_observer_->IncrementSparseEnumCounter(ssl_counter_type, |
| 2314 ssl_cipher_suite); | 2324 ssl_cipher_suite); |
| 2315 } | 2325 } |
| 2316 } | 2326 } |
| 2317 | 2327 |
| 2318 void WebRtcSession::OnSentPacket_w(const rtc::SentPacket& sent_packet) { | 2328 void WebRtcSession::OnSentPacket_w(const rtc::SentPacket& sent_packet) { |
| 2319 RTC_DCHECK(worker_thread()->IsCurrent()); | 2329 RTC_DCHECK(worker_thread()->IsCurrent()); |
| 2330 RTC_DCHECK(call_); |
| 2320 call_->OnSentPacket(sent_packet); | 2331 call_->OnSentPacket(sent_packet); |
| 2321 } | 2332 } |
| 2322 | 2333 |
| 2323 const std::string WebRtcSession::GetTransportName( | 2334 const std::string WebRtcSession::GetTransportName( |
| 2324 const std::string& content_name) { | 2335 const std::string& content_name) { |
| 2325 cricket::BaseChannel* channel = GetChannel(content_name); | 2336 cricket::BaseChannel* channel = GetChannel(content_name); |
| 2326 if (!channel) { | 2337 if (!channel) { |
| 2327 #ifdef HAVE_QUIC | 2338 #ifdef HAVE_QUIC |
| 2328 if (data_channel_type_ == cricket::DCT_QUIC && quic_data_transport_ && | 2339 if (data_channel_type_ == cricket::DCT_QUIC && quic_data_transport_ && |
| 2329 content_name == quic_data_transport_->transport_name()) { | 2340 content_name == quic_data_transport_->transport_name()) { |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2388 (rtp_data_channel_->rtcp_dtls_transport() != nullptr); | 2399 (rtp_data_channel_->rtcp_dtls_transport() != nullptr); |
| 2389 channel_manager_->DestroyRtpDataChannel(rtp_data_channel_.release()); | 2400 channel_manager_->DestroyRtpDataChannel(rtp_data_channel_.release()); |
| 2390 transport_controller_->DestroyDtlsTransport( | 2401 transport_controller_->DestroyDtlsTransport( |
| 2391 transport_name, cricket::ICE_CANDIDATE_COMPONENT_RTP); | 2402 transport_name, cricket::ICE_CANDIDATE_COMPONENT_RTP); |
| 2392 if (need_to_delete_rtcp) { | 2403 if (need_to_delete_rtcp) { |
| 2393 transport_controller_->DestroyDtlsTransport( | 2404 transport_controller_->DestroyDtlsTransport( |
| 2394 transport_name, cricket::ICE_CANDIDATE_COMPONENT_RTCP); | 2405 transport_name, cricket::ICE_CANDIDATE_COMPONENT_RTCP); |
| 2395 } | 2406 } |
| 2396 } | 2407 } |
| 2397 } // namespace webrtc | 2408 } // namespace webrtc |
| OLD | NEW |