Chromium Code Reviews

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

Issue 1207563002: Add flakiness check if there is no received packets in a certain period. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Address more comments Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « webrtc/p2p/base/dtlstransportchannel.h ('k') | webrtc/p2p/base/fakesession.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/dtlstransportchannel.cc
diff --git a/webrtc/p2p/base/dtlstransportchannel.cc b/webrtc/p2p/base/dtlstransportchannel.cc
index e73cf688bda12420e9745d034bec53e586eecfa6..f56001ba4d3a51943e414bad8fa97f9f86916f80 100644
--- a/webrtc/p2p/base/dtlstransportchannel.cc
+++ b/webrtc/p2p/base/dtlstransportchannel.cc
@@ -118,6 +118,8 @@ DtlsTransportChannelWrapper::DtlsTransportChannelWrapper(
&DtlsTransportChannelWrapper::OnRouteChange);
channel_->SignalConnectionRemoved.connect(this,
&DtlsTransportChannelWrapper::OnConnectionRemoved);
+ channel_->SignalReceivingState.connect(this,
+ &DtlsTransportChannelWrapper::OnReceivingState);
}
DtlsTransportChannelWrapper::~DtlsTransportChannelWrapper() {
@@ -456,6 +458,18 @@ void DtlsTransportChannelWrapper::OnWritableState(TransportChannel* channel) {
}
}
+void DtlsTransportChannelWrapper::OnReceivingState(TransportChannel* channel) {
+ ASSERT(rtc::Thread::Current() == worker_thread_);
+ ASSERT(channel == channel_);
+ LOG_J(LS_VERBOSE, this)
+ << "DTLSTransportChannelWrapper: channel receiving state changed to "
+ << channel_->receiving();
+ if (dtls_state_ == STATE_NONE || dtls_state_ == STATE_OPEN) {
+ // Note: SignalReceivingState fired by set_receiving.
+ set_receiving(channel_->receiving());
+ }
+}
+
void DtlsTransportChannelWrapper::OnReadPacket(
TransportChannel* channel, const char* data, size_t size,
const rtc::PacketTime& packet_time, int flags) {
« no previous file with comments | « webrtc/p2p/base/dtlstransportchannel.h ('k') | webrtc/p2p/base/fakesession.h » ('j') | no next file with comments »

Powered by Google App Engine