 Chromium Code Reviews
 Chromium Code Reviews Issue 1288033009:
  RTCCertificates added to RTCConfiguration, used by WebRtcSession/-DescriptionFactory  (Closed) 
  Base URL: https://chromium.googlesource.com/external/webrtc.git@master
    
  
    Issue 1288033009:
  RTCCertificates added to RTCConfiguration, used by WebRtcSession/-DescriptionFactory  (Closed) 
  Base URL: https://chromium.googlesource.com/external/webrtc.git@master| 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 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 700 const cricket::VideoCodec default_codec( | 700 const cricket::VideoCodec default_codec( | 
| 701 JsepSessionDescription::kDefaultVideoCodecId, | 701 JsepSessionDescription::kDefaultVideoCodecId, | 
| 702 JsepSessionDescription::kDefaultVideoCodecName, | 702 JsepSessionDescription::kDefaultVideoCodecName, | 
| 703 JsepSessionDescription::kMaxVideoCodecWidth, | 703 JsepSessionDescription::kMaxVideoCodecWidth, | 
| 704 JsepSessionDescription::kMaxVideoCodecHeight, | 704 JsepSessionDescription::kMaxVideoCodecHeight, | 
| 705 JsepSessionDescription::kDefaultVideoCodecFramerate, | 705 JsepSessionDescription::kDefaultVideoCodecFramerate, | 
| 706 JsepSessionDescription::kDefaultVideoCodecPreference); | 706 JsepSessionDescription::kDefaultVideoCodecPreference); | 
| 707 channel_manager_->SetDefaultVideoEncoderConfig( | 707 channel_manager_->SetDefaultVideoEncoderConfig( | 
| 708 cricket::VideoEncoderConfig(default_codec)); | 708 cricket::VideoEncoderConfig(default_codec)); | 
| 709 | 709 | 
| 710 webrtc_session_desc_factory_.reset(new WebRtcSessionDescriptionFactory( | 710 if (!dtls_enabled_) { | 
| 711 signaling_thread(), | 711 // Construct with DTLS disabled. | 
| 712 channel_manager_, | 712 webrtc_session_desc_factory_.reset(new WebRtcSessionDescriptionFactory( | 
| 713 mediastream_signaling_, | 713 signaling_thread(), | 
| 714 dtls_identity_store.Pass(), | 714 channel_manager_, | 
| 715 this, | 715 mediastream_signaling_, | 
| 716 id(), | 716 this, | 
| 717 data_channel_type_, | 717 id(), | 
| 718 dtls_enabled_)); | 718 data_channel_type_)); | 
| 719 } else { | |
| 720 // Construct with DTLS enabled. | |
| 721 rtc::scoped_refptr<rtc::RTCCertificate> certificate; | |
| 722 if (!rtc_configuration.certificates.empty()) | |
| 723 certificate = rtc_configuration.certificates[0]; | |
| 724 if (!certificate) { | |
| 
tommi
2015/08/20 14:58:11
I don't think you need this variable actually.
Her
 
hbos
2015/08/20 16:06:11
You're right. In latest PS though certificate != n
 | |
| 725 // Use the |dtls_identity_store| to generate a certificate. | |
| 726 webrtc_session_desc_factory_.reset(new WebRtcSessionDescriptionFactory( | |
| 727 signaling_thread(), | |
| 728 channel_manager_, | |
| 729 mediastream_signaling_, | |
| 730 dtls_identity_store.Pass(), | |
| 731 this, | |
| 732 id(), | |
| 733 data_channel_type_)); | |
| 734 } else { | |
| 735 // Use the already generated certificate. | |
| 
tommi
2015/08/20 14:58:11
is the intent to support multiple certificates eve
 
hbos
2015/08/20 16:06:11
The specs say if multiple are provided it is up to
 | |
| 736 webrtc_session_desc_factory_.reset(new WebRtcSessionDescriptionFactory( | |
| 737 signaling_thread(), | |
| 738 channel_manager_, | |
| 739 mediastream_signaling_, | |
| 740 certificate, | |
| 
tommi
2015/08/20 14:58:11
...and here you could pass rtc_configuration.certi
 | |
| 741 this, | |
| 742 id(), | |
| 743 data_channel_type_)); | |
| 744 } | |
| 745 } | |
| 719 | 746 | 
| 720 webrtc_session_desc_factory_->SignalIdentityReady.connect( | 747 webrtc_session_desc_factory_->SignalIdentityReady.connect( | 
| 721 this, &WebRtcSession::OnIdentityReady); | 748 this, &WebRtcSession::OnIdentityReady); | 
| 722 | 749 | 
| 723 if (options.disable_encryption) { | 750 if (options.disable_encryption) { | 
| 724 webrtc_session_desc_factory_->SetSdesPolicy(cricket::SEC_DISABLED); | 751 webrtc_session_desc_factory_->SetSdesPolicy(cricket::SEC_DISABLED); | 
| 725 } | 752 } | 
| 726 port_allocator()->set_candidate_filter( | 753 port_allocator()->set_candidate_filter( | 
| 727 ConvertIceTransportTypeToCandidateFilter(rtc_configuration.type)); | 754 ConvertIceTransportTypeToCandidateFilter(rtc_configuration.type)); | 
| 728 return true; | 755 return true; | 
| (...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1349 | 1376 | 
| 1350 void WebRtcSession::ResetIceRestartLatch() { | 1377 void WebRtcSession::ResetIceRestartLatch() { | 
| 1351 ice_restart_latch_->Reset(); | 1378 ice_restart_latch_->Reset(); | 
| 1352 } | 1379 } | 
| 1353 | 1380 | 
| 1354 void WebRtcSession::OnIdentityReady(rtc::SSLIdentity* identity) { | 1381 void WebRtcSession::OnIdentityReady(rtc::SSLIdentity* identity) { | 
| 1355 SetIdentity(identity); | 1382 SetIdentity(identity); | 
| 1356 } | 1383 } | 
| 1357 | 1384 | 
| 1358 bool WebRtcSession::waiting_for_identity() const { | 1385 bool WebRtcSession::waiting_for_identity() const { | 
| 1359 return webrtc_session_desc_factory_->waiting_for_identity(); | 1386 return webrtc_session_desc_factory_->waiting_for_certificate(); | 
| 1360 } | 1387 } | 
| 1361 | 1388 | 
| 1362 void WebRtcSession::SetIceConnectionState( | 1389 void WebRtcSession::SetIceConnectionState( | 
| 1363 PeerConnectionInterface::IceConnectionState state) { | 1390 PeerConnectionInterface::IceConnectionState state) { | 
| 1364 if (ice_connection_state_ == state) { | 1391 if (ice_connection_state_ == state) { | 
| 1365 return; | 1392 return; | 
| 1366 } | 1393 } | 
| 1367 | 1394 | 
| 1368 // ASSERT that the requested transition is allowed. Note that | 1395 // ASSERT that the requested transition is allowed. Note that | 
| 1369 // WebRtcSession does not implement "kIceConnectionClosed" (that is handled | 1396 // WebRtcSession does not implement "kIceConnectionClosed" (that is handled | 
| (...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2044 | 2071 | 
| 2045 if (!srtp_cipher.empty()) { | 2072 if (!srtp_cipher.empty()) { | 
| 2046 metrics_observer_->AddHistogramSample(srtp_name, srtp_cipher); | 2073 metrics_observer_->AddHistogramSample(srtp_name, srtp_cipher); | 
| 2047 } | 2074 } | 
| 2048 if (!ssl_cipher.empty()) { | 2075 if (!ssl_cipher.empty()) { | 
| 2049 metrics_observer_->AddHistogramSample(ssl_name, ssl_cipher); | 2076 metrics_observer_->AddHistogramSample(ssl_name, ssl_cipher); | 
| 2050 } | 2077 } | 
| 2051 } | 2078 } | 
| 2052 | 2079 | 
| 2053 } // namespace webrtc | 2080 } // namespace webrtc | 
| OLD | NEW |