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

Unified Diff: webrtc/pc/channel.cc

Issue 2537343003: Removing "crypto_required" from MediaContentDescription. (Closed)
Patch Set: Merge with master and clean up CreateDataChannel Created 4 years 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
« no previous file with comments | « webrtc/pc/channel.h ('k') | webrtc/pc/channel_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/pc/channel.cc
diff --git a/webrtc/pc/channel.cc b/webrtc/pc/channel.cc
index eb2f6340ea2482a6a6d455412864a7a91723be5f..1f29261ed2532bdf7422792b5e9878b7a06e3efc 100644
--- a/webrtc/pc/channel.cc
+++ b/webrtc/pc/channel.cc
@@ -164,7 +164,8 @@ BaseChannel::BaseChannel(rtc::Thread* worker_thread,
MediaChannel* media_channel,
TransportController* transport_controller,
const std::string& content_name,
- bool rtcp)
+ bool rtcp,
+ bool srtp_required)
: worker_thread_(worker_thread),
network_thread_(network_thread),
@@ -172,6 +173,7 @@ BaseChannel::BaseChannel(rtc::Thread* worker_thread,
transport_controller_(transport_controller),
rtcp_enabled_(rtcp),
+ srtp_required_(srtp_required),
media_channel_(media_channel),
selected_candidate_pair_(nullptr) {
RTC_DCHECK(worker_thread_ == rtc::Thread::Current());
@@ -726,7 +728,7 @@ bool BaseChannel::SendPacket(bool rtcp,
// Update the length of the packet now that we've added the auth tag.
packet->SetSize(len);
- } else if (secure_required_) {
+ } else if (srtp_required_) {
// The audio/video engines may attempt to send RTCP packets as soon as the
// streams are created, so don't treat this as an error for RTCP.
// See: https://bugs.chromium.org/p/webrtc/issues/detail?id=6809
@@ -815,7 +817,7 @@ void BaseChannel::HandlePacket(bool rtcp, rtc::CopyOnWriteBuffer* packet,
}
packet->SetSize(len);
- } else if (secure_required_) {
+ } else if (srtp_required_) {
// Our session description indicates that SRTP is required, but we got a
// packet before our SRTP filter is active. This means either that
// a) we got SRTP packets before we received the SDES keys, in which case
@@ -1091,7 +1093,7 @@ bool BaseChannel::SetRtpTransportParameters(
return true;
}
- // Cache secure_required_ for belt and suspenders check on SendPacket
+ // Cache srtp_required_ for belt and suspenders check on SendPacket
return network_thread_->Invoke<bool>(
RTC_FROM_HERE, Bind(&BaseChannel::SetRtpTransportParameters_n, this,
content, action, src, error_desc));
@@ -1104,10 +1106,6 @@ bool BaseChannel::SetRtpTransportParameters_n(
std::string* error_desc) {
RTC_DCHECK(network_thread_->IsCurrent());
- if (src == CS_LOCAL) {
- set_secure_required(content->crypto_required() != CT_NONE);
- }
-
if (!SetSrtp_n(content->cryptos(), action, src, error_desc)) {
return false;
}
@@ -1476,13 +1474,15 @@ VoiceChannel::VoiceChannel(rtc::Thread* worker_thread,
VoiceMediaChannel* media_channel,
TransportController* transport_controller,
const std::string& content_name,
- bool rtcp)
+ bool rtcp,
+ bool srtp_required)
: BaseChannel(worker_thread,
network_thread,
media_channel,
transport_controller,
content_name,
- rtcp),
+ rtcp,
+ srtp_required),
media_engine_(media_engine),
received_media_(false) {}
@@ -1889,13 +1889,15 @@ VideoChannel::VideoChannel(rtc::Thread* worker_thread,
VideoMediaChannel* media_channel,
TransportController* transport_controller,
const std::string& content_name,
- bool rtcp)
+ bool rtcp,
+ bool srtp_required)
: BaseChannel(worker_thread,
network_thread,
media_channel,
transport_controller,
content_name,
- rtcp) {}
+ rtcp,
+ srtp_required) {}
bool VideoChannel::Init_w(const std::string* bundle_transport_name) {
if (!BaseChannel::Init_w(bundle_transport_name)) {
@@ -2150,13 +2152,15 @@ DataChannel::DataChannel(rtc::Thread* worker_thread,
DataMediaChannel* media_channel,
TransportController* transport_controller,
const std::string& content_name,
- bool rtcp)
+ bool rtcp,
+ bool srtp_required)
: BaseChannel(worker_thread,
network_thread,
media_channel,
transport_controller,
content_name,
- rtcp),
+ rtcp,
+ srtp_required),
data_channel_type_(cricket::DCT_NONE),
ready_to_send_data_(false) {}
« no previous file with comments | « webrtc/pc/channel.h ('k') | webrtc/pc/channel_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698