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

Unified Diff: webrtc/pc/channelmanager.cc

Issue 1528843005: Add support for GCM cipher suites from RFC 7714. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Feedback from Matt Created 4 years, 7 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: webrtc/pc/channelmanager.cc
diff --git a/webrtc/pc/channelmanager.cc b/webrtc/pc/channelmanager.cc
index f59a3df9c72f7059e0c1a66aed639a66e2dbe518..86b6d31f55307235fe0b6be5e2b8420dd8130691 100644
--- a/webrtc/pc/channelmanager.cc
+++ b/webrtc/pc/channelmanager.cc
@@ -66,6 +66,7 @@ void ChannelManager::Construct(MediaEngineInterface* me,
audio_output_volume_ = kNotSetOutputVolume;
capturing_ = false;
enable_rtx_ = false;
+ crypto_options_ = rtc::CryptoOptions::NoGcm();
}
ChannelManager::~ChannelManager() {
@@ -99,6 +100,22 @@ bool ChannelManager::SetVideoRtxEnabled(bool enable) {
}
}
+bool ChannelManager::SetCryptoOptions(
+ const rtc::CryptoOptions& crypto_options) {
+ return worker_thread_->Invoke<bool>(Bind(
+ &ChannelManager::SetCryptoOptions_w, this, crypto_options));
+}
+
+bool ChannelManager::SetCryptoOptions_w(
+ const rtc::CryptoOptions& crypto_options) {
+ if (!video_channels_.empty() || !voice_channels_.empty() ||
+ !data_channels_.empty()) {
+ LOG(LS_WARNING) << "Not changing crypto options in existing channels.";
+ }
+ crypto_options_ = crypto_options;
+ return true;
+}
+
void ChannelManager::GetSupportedAudioCodecs(
std::vector<AudioCodec>* codecs) const {
codecs->clear();
@@ -230,6 +247,7 @@ VoiceChannel* ChannelManager::CreateVoiceChannel_w(
VoiceChannel* voice_channel =
new VoiceChannel(worker_thread_, media_engine_.get(), media_channel,
transport_controller, content_name, rtcp);
+ voice_channel->SetCryptoOptions(crypto_options_);
if (!voice_channel->Init()) {
delete voice_channel;
return nullptr;
@@ -288,6 +306,7 @@ VideoChannel* ChannelManager::CreateVideoChannel_w(
VideoChannel* video_channel = new VideoChannel(
worker_thread_, media_channel, transport_controller, content_name, rtcp);
+ video_channel->SetCryptoOptions(crypto_options_);
if (!video_channel->Init()) {
delete video_channel;
return NULL;
@@ -346,6 +365,7 @@ DataChannel* ChannelManager::CreateDataChannel_w(
DataChannel* data_channel = new DataChannel(
worker_thread_, media_channel, transport_controller, content_name, rtcp);
+ data_channel->SetCryptoOptions(crypto_options_);
if (!data_channel->Init()) {
LOG(LS_WARNING) << "Failed to init data channel.";
delete data_channel;

Powered by Google App Engine
This is Rietveld 408576698