Index: webrtc/p2p/base/dtlstransportchannel.cc |
diff --git a/webrtc/p2p/base/dtlstransportchannel.cc b/webrtc/p2p/base/dtlstransportchannel.cc |
index 6221057da43ef51d218ebf65fbafe61f38326911..a4f0e22cfaba4ba05eacbb54f2d36e04a358b6fc 100644 |
--- a/webrtc/p2p/base/dtlstransportchannel.cc |
+++ b/webrtc/p2p/base/dtlstransportchannel.cc |
@@ -104,7 +104,8 @@ void StreamInterfaceChannel::Close() { |
DtlsTransportChannelWrapper::DtlsTransportChannelWrapper( |
TransportChannelImpl* channel) |
- : TransportChannelImpl(channel->transport_name(), channel->component()), |
+ : transport_name_(channel->transport_name()), |
+ component_(channel->component()), |
network_thread_(rtc::Thread::Current()), |
channel_(channel), |
downward_(NULL), |
@@ -118,20 +119,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,57 +670,40 @@ bool DtlsTransportChannelWrapper::HandleDtlsPacket(const char* data, |
return downward_->OnPacketReceived(data, size); |
} |
-void DtlsTransportChannelWrapper::OnGatheringState( |
- TransportChannelImpl* channel) { |
- ASSERT(channel == channel_); |
- SignalGatheringState(this); |
-} |
- |
-void DtlsTransportChannelWrapper::OnCandidateGathered( |
- TransportChannelImpl* channel, |
- const Candidate& c) { |
- ASSERT(channel == channel_); |
- SignalCandidateGathered(this, c); |
-} |
- |
-void DtlsTransportChannelWrapper::OnCandidatesRemoved( |
- TransportChannelImpl* channel, |
- const Candidates& candidates) { |
- ASSERT(channel == channel_); |
- SignalCandidatesRemoved(this, candidates); |
-} |
- |
-void DtlsTransportChannelWrapper::OnRoleConflict( |
- TransportChannelImpl* channel) { |
- ASSERT(channel == channel_); |
- SignalRoleConflict(this); |
-} |
- |
-void DtlsTransportChannelWrapper::OnRouteChange( |
- TransportChannel* channel, const Candidate& candidate) { |
- ASSERT(channel == channel_); |
- SignalRouteChange(this, candidate); |
+void DtlsTransportChannelWrapper::OnDtlsHandshakeError( |
+ rtc::SSLHandshakeError error) { |
+ SignalDtlsHandshakeError(error); |
} |
-void DtlsTransportChannelWrapper::OnSelectedCandidatePairChanged( |
- TransportChannel* channel, |
- CandidatePairInterface* selected_candidate_pair, |
- int last_sent_packet_id, |
- bool ready_to_send) { |
- ASSERT(channel == channel_); |
- SignalSelectedCandidatePairChanged(this, selected_candidate_pair, |
- last_sent_packet_id, ready_to_send); |
+void DtlsTransportChannelWrapper::set_receiving(bool receiving) { |
+ if (receiving_ == receiving) { |
+ return; |
+ } |
+ receiving_ = receiving; |
+ SignalReceivingState(this); |
} |
-void DtlsTransportChannelWrapper::OnChannelStateChanged( |
- TransportChannelImpl* channel) { |
- ASSERT(channel == channel_); |
- SignalStateChanged(this); |
+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::OnDtlsHandshakeError( |
- rtc::SSLHandshakeError error) { |
- SignalDtlsHandshakeError(error); |
+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); |
} |
} // namespace cricket |