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

Unified Diff: webrtc/p2p/base/dtlstransportchannel.cc

Issue 2416023002: Introduce rtc::PacketTransportInterface and let cricket::TransportChannel inherit. (Closed)
Patch Set: Resolve unused variable issue in release build. Created 4 years, 2 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/p2p/base/dtlstransportchannel.cc
diff --git a/webrtc/p2p/base/dtlstransportchannel.cc b/webrtc/p2p/base/dtlstransportchannel.cc
index d95bdcd916b1814ae4eda1eaeebd4f333e59f2ac..ebfe56dfb9b51c01be4b78ea7b6a1f0e9113cc7f 100644
--- a/webrtc/p2p/base/dtlstransportchannel.cc
+++ b/webrtc/p2p/base/dtlstransportchannel.cc
@@ -14,6 +14,7 @@
#include "webrtc/p2p/base/dtlstransportchannel.h"
#include "webrtc/p2p/base/common.h"
+#include "webrtc/p2p/base/packettransport.h"
#include "webrtc/base/buffer.h"
#include "webrtc/base/checks.h"
#include "webrtc/base/dscp.h"
@@ -437,9 +438,10 @@ bool DtlsTransportChannelWrapper::IsDtlsConnected() {
// start the DTLS handshake
// - Once the DTLS handshake completes, the state is that of the
// impl again
-void DtlsTransportChannelWrapper::OnWritableState(TransportChannel* channel) {
+void DtlsTransportChannelWrapper::OnWritableState(rtc::PacketTransport* pt) {
+ TransportChannel* channel = static_cast<TransportChannel*>(pt);
pthatcher1 2016/10/13 20:26:37 The only thing this method needs from pt is ->writ
johan 2016/10/14 16:09:33 Done.
ASSERT(rtc::Thread::Current() == worker_thread_);
- ASSERT(channel == channel_);
+ RTC_DCHECK(channel == channel_);
LOG_J(LS_VERBOSE, this)
<< "DTLSTransportChannelWrapper: channel writable state changed to "
<< channel_->writable();
@@ -471,7 +473,7 @@ void DtlsTransportChannelWrapper::OnWritableState(TransportChannel* channel) {
void DtlsTransportChannelWrapper::OnReceivingState(TransportChannel* channel) {
ASSERT(rtc::Thread::Current() == worker_thread_);
- ASSERT(channel == channel_);
+ RTC_DCHECK(channel == channel_);
LOG_J(LS_VERBOSE, this)
<< "DTLSTransportChannelWrapper: channel receiving state changed to "
<< channel_->receiving();
@@ -482,10 +484,14 @@ void DtlsTransportChannelWrapper::OnReceivingState(TransportChannel* channel) {
}
void DtlsTransportChannelWrapper::OnReadPacket(
- TransportChannel* channel, const char* data, size_t size,
- const rtc::PacketTime& packet_time, int flags) {
+ rtc::PacketTransport* pt,
+ const char* data,
+ size_t size,
+ const rtc::PacketTime& packet_time,
+ int flags) {
+ TransportChannel* channel = static_cast<TransportChannel*>(pt);
ASSERT(rtc::Thread::Current() == worker_thread_);
- ASSERT(channel == channel_);
+ RTC_DCHECK(channel == channel_);
ASSERT(flags == 0);
if (!dtls_active_) {
@@ -558,14 +564,14 @@ void DtlsTransportChannelWrapper::OnReadPacket(
}
void DtlsTransportChannelWrapper::OnSentPacket(
- TransportChannel* channel,
+ rtc::PacketTransport* pt,
const rtc::SentPacket& sent_packet) {
ASSERT(rtc::Thread::Current() == worker_thread_);
SignalSentPacket(this, sent_packet);
}
-void DtlsTransportChannelWrapper::OnReadyToSend(TransportChannel* channel) {
+void DtlsTransportChannelWrapper::OnReadyToSend(rtc::PacketTransport* pt) {
if (writable()) {
SignalReadyToSend(this);
}

Powered by Google App Engine
This is Rietveld 408576698