| Index: webrtc/p2p/base/dtlstransportchannel.cc
|
| diff --git a/webrtc/p2p/base/dtlstransportchannel.cc b/webrtc/p2p/base/dtlstransportchannel.cc
|
| index 6221057da43ef51d218ebf65fbafe61f38326911..885777dd6beb813648090007b42e049c62b14255 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,57 +669,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
|
|
|