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

Unified Diff: talk/app/webrtc/webrtcsession.cc

Issue 1288033009: RTCCertificates added to RTCConfiguration, used by WebRtcSession/-DescriptionFactory (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: talk/app/webrtc/webrtcsession.cc
diff --git a/talk/app/webrtc/webrtcsession.cc b/talk/app/webrtc/webrtcsession.cc
index fde45104d61ddfafee2791b1e297d164ab6425ac..31e96ad1a47c10d02981ae11f43c7f705b77d834 100644
--- a/talk/app/webrtc/webrtcsession.cc
+++ b/talk/app/webrtc/webrtcsession.cc
@@ -707,15 +707,42 @@ bool WebRtcSession::Initialize(
channel_manager_->SetDefaultVideoEncoderConfig(
cricket::VideoEncoderConfig(default_codec));
- webrtc_session_desc_factory_.reset(new WebRtcSessionDescriptionFactory(
- signaling_thread(),
- channel_manager_,
- mediastream_signaling_,
- dtls_identity_store.Pass(),
- this,
- id(),
- data_channel_type_,
- dtls_enabled_));
+ if (!dtls_enabled_) {
+ // Construct with DTLS disabled.
+ webrtc_session_desc_factory_.reset(new WebRtcSessionDescriptionFactory(
+ signaling_thread(),
+ channel_manager_,
+ mediastream_signaling_,
+ this,
+ id(),
+ data_channel_type_));
+ } else {
+ // Construct with DTLS enabled.
+ rtc::scoped_refptr<rtc::RTCCertificate> certificate;
+ if (!rtc_configuration.certificates.empty())
+ certificate = rtc_configuration.certificates[0];
+ 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
+ // Use the |dtls_identity_store| to generate a certificate.
+ webrtc_session_desc_factory_.reset(new WebRtcSessionDescriptionFactory(
+ signaling_thread(),
+ channel_manager_,
+ mediastream_signaling_,
+ dtls_identity_store.Pass(),
+ this,
+ id(),
+ data_channel_type_));
+ } else {
+ // 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
+ webrtc_session_desc_factory_.reset(new WebRtcSessionDescriptionFactory(
+ signaling_thread(),
+ channel_manager_,
+ mediastream_signaling_,
+ certificate,
tommi 2015/08/20 14:58:11 ...and here you could pass rtc_configuration.certi
+ this,
+ id(),
+ data_channel_type_));
+ }
+ }
webrtc_session_desc_factory_->SignalIdentityReady.connect(
this, &WebRtcSession::OnIdentityReady);
@@ -1356,7 +1383,7 @@ void WebRtcSession::OnIdentityReady(rtc::SSLIdentity* identity) {
}
bool WebRtcSession::waiting_for_identity() const {
- return webrtc_session_desc_factory_->waiting_for_identity();
+ return webrtc_session_desc_factory_->waiting_for_certificate();
}
void WebRtcSession::SetIceConnectionState(

Powered by Google App Engine
This is Rietveld 408576698