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

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

Issue 2606123002: Remove the dependency of TransportChannel and TransportChannelImpl. (Closed)
Patch Set: Revert the change of stun_unittests Created 3 years, 11 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 912b90e80b18c99a8fcc724b80b4cb0c6b2d66b3..9be856c6966813d5861c43ffefdec7d72e1ff15f 100644
--- a/webrtc/p2p/base/dtlstransportchannel.cc
+++ b/webrtc/p2p/base/dtlstransportchannel.cc
@@ -50,11 +50,10 @@ static bool IsRtpPacket(const char* data, size_t len) {
return (len >= kMinRtpPacketLen && (u[0] & 0xC0) == 0x80);
}
-StreamInterfaceChannel::StreamInterfaceChannel(TransportChannel* channel)
+StreamInterfaceChannel::StreamInterfaceChannel(IceTransportInternal* channel)
: channel_(channel),
state_(rtc::SS_OPEN),
- packets_(kMaxPendingPackets, kMaxDtlsPacketLen) {
-}
+ packets_(kMaxPendingPackets, kMaxDtlsPacketLen) {}
rtc::StreamResult StreamInterfaceChannel::Read(void* buffer,
size_t buffer_len,
@@ -103,8 +102,9 @@ void StreamInterfaceChannel::Close() {
}
DtlsTransportChannelWrapper::DtlsTransportChannelWrapper(
- TransportChannelImpl* channel)
- : TransportChannelImpl(channel->transport_name(), channel->component()),
+ IceTransportInternal* channel)
+ : transport_name_(channel->transport_name()),
+ component_(channel->component()),
network_thread_(rtc::Thread::Current()),
channel_(channel),
downward_(NULL),
@@ -118,20 +118,6 @@ DtlsTransportChannelWrapper::DtlsTransportChannelWrapper(
this, &DtlsTransportChannelWrapper::OnSentPacket);
channel_->SignalReadyToSend.connect(this,
&DtlsTransportChannelWrapper::OnReadyToSend);
- channel_->SignalGatheringState.connect(
- this, &DtlsTransportChannelWrapper::OnGatheringState);
- channel_->SignalCandidateGathered.connect(
- this, &DtlsTransportChannelWrapper::OnCandidateGathered);
- channel_->SignalCandidatesRemoved.connect(
- this, &DtlsTransportChannelWrapper::OnCandidatesRemoved);
- channel_->SignalRoleConflict.connect(this,
- &DtlsTransportChannelWrapper::OnRoleConflict);
- channel_->SignalRouteChange.connect(this,
- &DtlsTransportChannelWrapper::OnRouteChange);
- channel_->SignalSelectedCandidatePairChanged.connect(
- this, &DtlsTransportChannelWrapper::OnSelectedCandidatePairChanged);
- channel_->SignalStateChanged.connect(
- this, &DtlsTransportChannelWrapper::OnChannelStateChanged);
channel_->SignalReceivingState.connect(this,
&DtlsTransportChannelWrapper::OnReceivingState);
}
@@ -683,52 +669,35 @@ bool DtlsTransportChannelWrapper::HandleDtlsPacket(const char* data,
return downward_->OnPacketReceived(data, size);
}
-void DtlsTransportChannelWrapper::OnGatheringState(
- TransportChannelImpl* channel) {
- RTC_DCHECK(channel == channel_);
- SignalGatheringState(this);
-}
-
-void DtlsTransportChannelWrapper::OnCandidateGathered(
- TransportChannelImpl* channel,
- const Candidate& c) {
- RTC_DCHECK(channel == channel_);
- SignalCandidateGathered(this, c);
-}
-
-void DtlsTransportChannelWrapper::OnCandidatesRemoved(
- TransportChannelImpl* channel,
- const Candidates& candidates) {
- RTC_DCHECK(channel == channel_);
- SignalCandidatesRemoved(this, candidates);
-}
-
-void DtlsTransportChannelWrapper::OnRoleConflict(
- TransportChannelImpl* channel) {
- RTC_DCHECK(channel == channel_);
- SignalRoleConflict(this);
-}
-
-void DtlsTransportChannelWrapper::OnRouteChange(
- TransportChannel* channel, const Candidate& candidate) {
- RTC_DCHECK(channel == channel_);
- SignalRouteChange(this, candidate);
+void DtlsTransportChannelWrapper::set_receiving(bool receiving) {
+ if (receiving_ == receiving) {
+ return;
+ }
+ receiving_ = receiving;
+ SignalReceivingState(this);
}
-void DtlsTransportChannelWrapper::OnSelectedCandidatePairChanged(
- TransportChannel* channel,
- CandidatePairInterface* selected_candidate_pair,
- int last_sent_packet_id,
- bool ready_to_send) {
- RTC_DCHECK(channel == channel_);
- SignalSelectedCandidatePairChanged(this, selected_candidate_pair,
- last_sent_packet_id, ready_to_send);
+void DtlsTransportChannelWrapper::set_writable(bool writable) {
+ if (writable_ == writable) {
+ return;
+ }
+ LOG_J(LS_VERBOSE, this) << "set_writable from:" << writable_ << " to "
+ << writable;
+ writable_ = writable;
+ if (writable_) {
+ SignalReadyToSend(this);
+ }
+ SignalWritableState(this);
}
-void DtlsTransportChannelWrapper::OnChannelStateChanged(
- TransportChannelImpl* channel) {
- RTC_DCHECK(channel == channel_);
- SignalStateChanged(this);
+void DtlsTransportChannelWrapper::set_dtls_state(DtlsTransportState state) {
+ if (dtls_state_ == state) {
+ return;
+ }
+ LOG_J(LS_VERBOSE, this) << "set_dtls_state from:" << dtls_state_ << " to "
+ << state;
+ dtls_state_ = state;
+ SignalDtlsState(this, state);
}
void DtlsTransportChannelWrapper::OnDtlsHandshakeError(

Powered by Google App Engine
This is Rietveld 408576698