OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
557 SignalVoiceChannelDestroyed(); | 557 SignalVoiceChannelDestroyed(); |
558 channel_manager_->DestroyVoiceChannel(voice_channel_.release(), nullptr); | 558 channel_manager_->DestroyVoiceChannel(voice_channel_.release(), nullptr); |
559 } | 559 } |
560 if (data_channel_) { | 560 if (data_channel_) { |
561 SignalDataChannelDestroyed(); | 561 SignalDataChannelDestroyed(); |
562 channel_manager_->DestroyDataChannel(data_channel_.release()); | 562 channel_manager_->DestroyDataChannel(data_channel_.release()); |
563 } | 563 } |
564 for (size_t i = 0; i < saved_candidates_.size(); ++i) { | 564 for (size_t i = 0; i < saved_candidates_.size(); ++i) { |
565 delete saved_candidates_[i]; | 565 delete saved_candidates_[i]; |
566 } | 566 } |
567 delete identity(); | |
568 } | 567 } |
569 | 568 |
570 bool WebRtcSession::Initialize( | 569 bool WebRtcSession::Initialize( |
571 const PeerConnectionFactoryInterface::Options& options, | 570 const PeerConnectionFactoryInterface::Options& options, |
572 const MediaConstraintsInterface* constraints, | 571 const MediaConstraintsInterface* constraints, |
573 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store, | 572 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store, |
574 const PeerConnectionInterface::RTCConfiguration& rtc_configuration) { | 573 const PeerConnectionInterface::RTCConfiguration& rtc_configuration) { |
575 bundle_policy_ = rtc_configuration.bundle_policy; | 574 bundle_policy_ = rtc_configuration.bundle_policy; |
576 rtcp_mux_policy_ = rtc_configuration.rtcp_mux_policy; | 575 rtcp_mux_policy_ = rtc_configuration.rtcp_mux_policy; |
577 SetSslMaxProtocolVersion(options.ssl_max_version); | 576 SetSslMaxProtocolVersion(options.ssl_max_version); |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
744 signaling_thread(), | 743 signaling_thread(), |
745 channel_manager_, | 744 channel_manager_, |
746 mediastream_signaling_, | 745 mediastream_signaling_, |
747 certificate, | 746 certificate, |
748 this, | 747 this, |
749 id(), | 748 id(), |
750 data_channel_type_)); | 749 data_channel_type_)); |
751 } | 750 } |
752 } | 751 } |
753 | 752 |
754 webrtc_session_desc_factory_->SignalIdentityReady.connect( | 753 webrtc_session_desc_factory_->SignalCertificateReady.connect( |
755 this, &WebRtcSession::OnIdentityReady); | 754 this, &WebRtcSession::OnCertificateReady); |
756 | 755 |
757 if (options.disable_encryption) { | 756 if (options.disable_encryption) { |
758 webrtc_session_desc_factory_->SetSdesPolicy(cricket::SEC_DISABLED); | 757 webrtc_session_desc_factory_->SetSdesPolicy(cricket::SEC_DISABLED); |
759 } | 758 } |
760 port_allocator()->set_candidate_filter( | 759 port_allocator()->set_candidate_filter( |
761 ConvertIceTransportTypeToCandidateFilter(rtc_configuration.type)); | 760 ConvertIceTransportTypeToCandidateFilter(rtc_configuration.type)); |
762 | 761 |
763 if (rtc_configuration.enable_localhost_ice_candidate) { | 762 if (rtc_configuration.enable_localhost_ice_candidate) { |
764 port_allocator()->set_flags( | 763 port_allocator()->set_flags( |
765 port_allocator()->flags() | | 764 port_allocator()->flags() | |
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1385 } | 1384 } |
1386 | 1385 |
1387 bool WebRtcSession::IceRestartPending() const { | 1386 bool WebRtcSession::IceRestartPending() const { |
1388 return ice_restart_latch_->Get(); | 1387 return ice_restart_latch_->Get(); |
1389 } | 1388 } |
1390 | 1389 |
1391 void WebRtcSession::ResetIceRestartLatch() { | 1390 void WebRtcSession::ResetIceRestartLatch() { |
1392 ice_restart_latch_->Reset(); | 1391 ice_restart_latch_->Reset(); |
1393 } | 1392 } |
1394 | 1393 |
1395 void WebRtcSession::OnIdentityReady(rtc::SSLIdentity* identity) { | 1394 void WebRtcSession::OnCertificateReady( |
1396 SetIdentity(identity); | 1395 const rtc::scoped_refptr<rtc::RTCCertificate>& certificate) { |
| 1396 SetCertificate(certificate); |
1397 } | 1397 } |
1398 | 1398 |
1399 bool WebRtcSession::waiting_for_identity_for_testing() const { | 1399 bool WebRtcSession::waiting_for_certificate_for_testing() const { |
1400 return webrtc_session_desc_factory_->waiting_for_certificate_for_testing(); | 1400 return webrtc_session_desc_factory_->waiting_for_certificate_for_testing(); |
1401 } | 1401 } |
1402 | 1402 |
1403 void WebRtcSession::SetIceConnectionState( | 1403 void WebRtcSession::SetIceConnectionState( |
1404 PeerConnectionInterface::IceConnectionState state) { | 1404 PeerConnectionInterface::IceConnectionState state) { |
1405 if (ice_connection_state_ == state) { | 1405 if (ice_connection_state_ == state) { |
1406 return; | 1406 return; |
1407 } | 1407 } |
1408 | 1408 |
1409 // ASSERT that the requested transition is allowed. Note that | 1409 // ASSERT that the requested transition is allowed. Note that |
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2085 | 2085 |
2086 if (!srtp_cipher.empty()) { | 2086 if (!srtp_cipher.empty()) { |
2087 metrics_observer_->AddHistogramSample(srtp_name, srtp_cipher); | 2087 metrics_observer_->AddHistogramSample(srtp_name, srtp_cipher); |
2088 } | 2088 } |
2089 if (!ssl_cipher.empty()) { | 2089 if (!ssl_cipher.empty()) { |
2090 metrics_observer_->AddHistogramSample(ssl_name, ssl_cipher); | 2090 metrics_observer_->AddHistogramSample(ssl_name, ssl_cipher); |
2091 } | 2091 } |
2092 } | 2092 } |
2093 | 2093 |
2094 } // namespace webrtc | 2094 } // namespace webrtc |
OLD | NEW |