Chromium Code Reviews| Index: content/renderer/media/rtc_peer_connection_handler.cc |
| diff --git a/content/renderer/media/rtc_peer_connection_handler.cc b/content/renderer/media/rtc_peer_connection_handler.cc |
| index 8e5e4235b189d25d498501bbfba7c4257509da51..2df2c5d99f08856d07574cc82b26283639d1948b 100644 |
| --- a/content/renderer/media/rtc_peer_connection_handler.cc |
| +++ b/content/renderer/media/rtc_peer_connection_handler.cc |
| @@ -722,6 +722,20 @@ void ConvertConstraintsToWebrtcOfferOptions( |
| base::LazyInstance<std::set<RTCPeerConnectionHandler*> >::Leaky |
| g_peer_connection_handlers = LAZY_INSTANCE_INITIALIZER; |
| +void OverrideDefaultCertificateBasedOnExperiment( |
| + webrtc::PeerConnectionInterface::RTCConfiguration* config) { |
| + if (base::FeatureList::IsEnabled(features::kWebRtcEcdsaDefault)) { |
| + if (config->certificates.empty()) { |
| + rtc::scoped_refptr<rtc::RTCCertificate> certificate = |
| + PeerConnectionDependencyFactory::GenerateDefaultCertificate(); |
| + config->certificates.push_back(certificate); |
| + } |
| + } |
| + // If the ECDSA experiment is not running we rely on the default being RSA for |
| + // the control group. See bug related to this: crbug.com/611698. |
| + DCHECK(rtc::KT_DEFAULT == rtc::KT_RSA); |
|
tommi (sloooow) - chröme
2016/05/13 13:27:06
Did you mean to do a static (compile time) assert
hbos_chromium
2016/05/13 14:35:31
Done.
|
| +} |
| + |
| } // namespace |
| // Implementation of LocalRTCStatsRequest. |
| @@ -952,14 +966,7 @@ bool RTCPeerConnectionHandler::initialize( |
| webrtc::PeerConnectionInterface::RTCConfiguration config; |
| GetNativeRtcConfiguration(server_configuration, &config); |
| - |
| - if (base::FeatureList::IsEnabled(features::kWebRtcEcdsaDefault)) { |
| - if (config.certificates.empty()) { |
| - rtc::scoped_refptr<rtc::RTCCertificate> certificate = |
| - PeerConnectionDependencyFactory::GenerateDefaultCertificate(); |
| - config.certificates.push_back(certificate); |
| - } |
| - } |
| + OverrideDefaultCertificateBasedOnExperiment(&config); |
| // Choose between RTC smoothness algorithm and prerenderer smoothing. |
| // Prerenderer smoothing is turned on if RTC smoothness is turned off. |
| @@ -996,14 +1003,7 @@ bool RTCPeerConnectionHandler::InitializeForTest( |
| DCHECK(thread_checker_.CalledOnValidThread()); |
| webrtc::PeerConnectionInterface::RTCConfiguration config; |
| GetNativeRtcConfiguration(server_configuration, &config); |
| - |
| - if (base::FeatureList::IsEnabled(features::kWebRtcEcdsaDefault)) { |
| - if (config.certificates.empty()) { |
| - rtc::scoped_refptr<rtc::RTCCertificate> certificate = |
| - PeerConnectionDependencyFactory::GenerateDefaultCertificate(); |
| - config.certificates.push_back(certificate); |
| - } |
| - } |
| + OverrideDefaultCertificateBasedOnExperiment(&config); |
| peer_connection_observer_ = new Observer(weak_factory_.GetWeakPtr()); |
| CopyConstraintsIntoRtcConfiguration(options, &config); |