| Index: webrtc/p2p/base/jseptransport.cc
|
| diff --git a/webrtc/p2p/base/jseptransport.cc b/webrtc/p2p/base/jseptransport.cc
|
| index 159c238a7937128f9dc4ce0172019061ab39c2ad..c3d6755056706c6215078d71506d26db43984aa1 100644
|
| --- a/webrtc/p2p/base/jseptransport.cc
|
| +++ b/webrtc/p2p/base/jseptransport.cc
|
| @@ -8,19 +8,20 @@
|
| * be found in the AUTHORS file in the root of the source tree.
|
| */
|
|
|
| -#include "webrtc/p2p/base/jseptransport.h"
|
| -
|
| #include <memory>
|
| #include <utility> // for std::pair
|
|
|
| -#include "webrtc/base/bind.h"
|
| -#include "webrtc/base/checks.h"
|
| -#include "webrtc/base/logging.h"
|
| +#include "webrtc/p2p/base/jseptransport.h"
|
| +
|
| #include "webrtc/p2p/base/candidate.h"
|
| #include "webrtc/p2p/base/dtlstransportchannel.h"
|
| #include "webrtc/p2p/base/p2pconstants.h"
|
| #include "webrtc/p2p/base/p2ptransportchannel.h"
|
| #include "webrtc/p2p/base/port.h"
|
| +#include "webrtc/p2p/base/transportchannelimpl.h"
|
| +#include "webrtc/base/bind.h"
|
| +#include "webrtc/base/checks.h"
|
| +#include "webrtc/base/logging.h"
|
|
|
| namespace cricket {
|
|
|
| @@ -126,7 +127,7 @@
|
| const rtc::scoped_refptr<rtc::RTCCertificate>& certificate)
|
| : mid_(mid), certificate_(certificate) {}
|
|
|
| -bool JsepTransport::AddChannel(DtlsTransportInternal* dtls, int component) {
|
| +bool JsepTransport::AddChannel(TransportChannelImpl* dtls, int component) {
|
| if (channels_.find(component) != channels_.end()) {
|
| LOG(LS_ERROR) << "Adding channel for component " << component << " twice.";
|
| return false;
|
| @@ -285,14 +286,13 @@
|
| stats->transport_name = mid();
|
| stats->channel_stats.clear();
|
| for (auto& kv : channels_) {
|
| - DtlsTransportInternal* dtls_transport = kv.second;
|
| + TransportChannelImpl* channel = kv.second;
|
| TransportChannelStats substats;
|
| substats.component = kv.first;
|
| - dtls_transport->GetSrtpCryptoSuite(&substats.srtp_crypto_suite);
|
| - dtls_transport->GetSslCipherSuite(&substats.ssl_cipher_suite);
|
| - substats.dtls_state = dtls_transport->dtls_state();
|
| - if (!dtls_transport->ice_transport()->GetStats(
|
| - &substats.connection_infos)) {
|
| + channel->GetSrtpCryptoSuite(&substats.srtp_crypto_suite);
|
| + channel->GetSslCipherSuite(&substats.ssl_cipher_suite);
|
| + substats.dtls_state = channel->dtls_state();
|
| + if (!channel->GetStats(&substats.connection_infos)) {
|
| return false;
|
| }
|
| stats->channel_stats.push_back(substats);
|
| @@ -325,39 +325,36 @@
|
| }
|
|
|
| bool JsepTransport::ApplyLocalTransportDescription(
|
| - DtlsTransportInternal* dtls_transport,
|
| + TransportChannelImpl* channel,
|
| std::string* error_desc) {
|
| - dtls_transport->ice_transport()->SetIceParameters(
|
| - local_description_->GetIceParameters());
|
| + channel->SetIceParameters(local_description_->GetIceParameters());
|
| return true;
|
| }
|
|
|
| bool JsepTransport::ApplyRemoteTransportDescription(
|
| - DtlsTransportInternal* dtls_transport,
|
| + TransportChannelImpl* channel,
|
| std::string* error_desc) {
|
| // Currently, all ICE-related calls still go through this DTLS channel. But
|
| // that will change once we get rid of TransportChannelImpl, and the DTLS
|
| // channel interface no longer includes ICE-specific methods. Then this class
|
| // will need to call dtls->ice()->SetIceRole(), for example, assuming the Dtls
|
| // interface will expose its inner ICE channel.
|
| - dtls_transport->ice_transport()->SetRemoteIceParameters(
|
| - remote_description_->GetIceParameters());
|
| - dtls_transport->ice_transport()->SetRemoteIceMode(
|
| - remote_description_->ice_mode);
|
| + channel->SetRemoteIceParameters(remote_description_->GetIceParameters());
|
| + channel->SetRemoteIceMode(remote_description_->ice_mode);
|
| return true;
|
| }
|
|
|
| bool JsepTransport::ApplyNegotiatedTransportDescription(
|
| - DtlsTransportInternal* dtls_transport,
|
| + TransportChannelImpl* channel,
|
| std::string* error_desc) {
|
| // Set SSL role. Role must be set before fingerprint is applied, which
|
| // initiates DTLS setup.
|
| - if (!dtls_transport->SetSslRole(secure_role_)) {
|
| + if (!channel->SetSslRole(secure_role_)) {
|
| return BadTransportDescription("Failed to set SSL role for the channel.",
|
| error_desc);
|
| }
|
| // Apply remote fingerprint.
|
| - if (!dtls_transport->SetRemoteFingerprint(
|
| + if (!channel->SetRemoteFingerprint(
|
| remote_fingerprint_->algorithm,
|
| reinterpret_cast<const uint8_t*>(remote_fingerprint_->digest.data()),
|
| remote_fingerprint_->digest.size())) {
|
|
|