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

Unified Diff: webrtc/api/webrtcsession.cc

Issue 1844803002: Modify PeerConnection for end-to-end QuicDataChannel usage (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 9 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/api/webrtcsession.cc
diff --git a/webrtc/api/webrtcsession.cc b/webrtc/api/webrtcsession.cc
index 19f5aa4128aea083feaf5c3065cde77a6e52c3d9..932faa6ceb3a85570cd5b71380b95131acfd80cc 100644
--- a/webrtc/api/webrtcsession.cc
+++ b/webrtc/api/webrtcsession.cc
@@ -24,6 +24,7 @@
#include "webrtc/api/webrtcsessiondescriptionfactory.h"
#include "webrtc/audio_sink.h"
#include "webrtc/base/basictypes.h"
+#include "webrtc/base/bind.h"
#include "webrtc/base/checks.h"
#include "webrtc/base/helpers.h"
#include "webrtc/base/logging.h"
@@ -1735,6 +1736,13 @@ void WebRtcSession::RemoveUnusedChannels(const SessionDescription* desc) {
// TODO(mallinath) - Add a correct error code if the channels are not created
// due to BUNDLE is enabled but rtcp-mux is disabled.
bool WebRtcSession::CreateChannels(const SessionDescription* desc) {
+ // TODO(mikescarlett): Allow remote peer to negotiate whether to use QUIC
+ // or DTLS, so that the connection doesn't fail when the remote peer won't use
+ // QUIC. Current behavior is to assume either both peers or no peers use QUIC.
+ if (desc->quic() && !transport_controller_->quic()) {
+ transport_controller_->set_quic(true);
Taylor Brandstetter 2016/04/01 23:23:42 This should fail if a transport channel has alread
+ data_channel_type_ = cricket::DCT_QUIC;
+ }
// Creating the media channels and transport proxies.
const cricket::ContentInfo* voice = cricket::GetFirstAudioContent(desc);
if (voice && !voice->rejected && !voice_channel_) {
@@ -1754,7 +1762,8 @@ bool WebRtcSession::CreateChannels(const SessionDescription* desc) {
const cricket::ContentInfo* data = cricket::GetFirstDataContent(desc);
if (data_channel_type_ != cricket::DCT_NONE &&
- data && !data->rejected && !data_channel_) {
+ data_channel_type_ != cricket::DCT_QUIC && data && !data->rejected &&
+ !data_channel_) {
if (!CreateDataChannel(data)) {
LOG(LS_ERROR) << "Failed to create data channel.";
return false;
@@ -1825,6 +1834,10 @@ bool WebRtcSession::CreateVideoChannel(const cricket::ContentInfo* content) {
}
bool WebRtcSession::CreateDataChannel(const cricket::ContentInfo* content) {
+ if (data_channel_type_ == cricket::DCT_QUIC) {
+ transport_controller_->CreateTransportChannel_w(content->name, 0);
+ return true;
+ }
bool sctp = (data_channel_type_ == cricket::DCT_SCTP);
data_channel_.reset(channel_manager_->CreateDataChannel(
transport_controller_.get(), content->name, !sctp, data_channel_type_));
@@ -2166,4 +2179,8 @@ void WebRtcSession::OnSentPacket_w(cricket::TransportChannel* channel,
media_controller_->call_w()->OnSentPacket(sent_packet);
}
+cricket::QuicTransportChannel* WebRtcSession::quic_transport_channel() const {
+ return transport_controller_->quic_transport_channel();
+}
pthatcher1 2016/03/30 20:34:49 And does this need the ifdef as well?
+
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698