| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2015 The WebRTC Project Authors. All rights reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 channel->SignalReceivingState.connect( | 170 channel->SignalReceivingState.connect( |
| 171 this, &TransportController::OnChannelReceivingState_n); | 171 this, &TransportController::OnChannelReceivingState_n); |
| 172 channel->SignalGatheringState.connect( | 172 channel->SignalGatheringState.connect( |
| 173 this, &TransportController::OnChannelGatheringState_n); | 173 this, &TransportController::OnChannelGatheringState_n); |
| 174 channel->SignalCandidateGathered.connect( | 174 channel->SignalCandidateGathered.connect( |
| 175 this, &TransportController::OnChannelCandidateGathered_n); | 175 this, &TransportController::OnChannelCandidateGathered_n); |
| 176 channel->SignalCandidatesRemoved.connect( | 176 channel->SignalCandidatesRemoved.connect( |
| 177 this, &TransportController::OnChannelCandidatesRemoved_n); | 177 this, &TransportController::OnChannelCandidatesRemoved_n); |
| 178 channel->SignalRoleConflict.connect( | 178 channel->SignalRoleConflict.connect( |
| 179 this, &TransportController::OnChannelRoleConflict_n); | 179 this, &TransportController::OnChannelRoleConflict_n); |
| 180 channel->SignalConnectionRemoved.connect( | 180 channel->SignalStateChanged.connect( |
| 181 this, &TransportController::OnChannelConnectionRemoved_n); | 181 this, &TransportController::OnChannelStateChanged_n); |
| 182 channels_.insert(channels_.end(), RefCountedChannel(channel))->AddRef(); | 182 channels_.insert(channels_.end(), RefCountedChannel(channel))->AddRef(); |
| 183 // Adding a channel could cause aggregate state to change. | 183 // Adding a channel could cause aggregate state to change. |
| 184 UpdateAggregateStates_n(); | 184 UpdateAggregateStates_n(); |
| 185 return channel; | 185 return channel; |
| 186 } | 186 } |
| 187 | 187 |
| 188 void TransportController::DestroyTransportChannel_n( | 188 void TransportController::DestroyTransportChannel_n( |
| 189 const std::string& transport_name, | 189 const std::string& transport_name, |
| 190 int component) { | 190 int component) { |
| 191 RTC_DCHECK(network_thread_->IsCurrent()); | 191 RTC_DCHECK(network_thread_->IsCurrent()); |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 585 | 585 |
| 586 ice_role_switch_ = true; | 586 ice_role_switch_ = true; |
| 587 IceRole reversed_role = (ice_role_ == ICEROLE_CONTROLLING) | 587 IceRole reversed_role = (ice_role_ == ICEROLE_CONTROLLING) |
| 588 ? ICEROLE_CONTROLLED | 588 ? ICEROLE_CONTROLLED |
| 589 : ICEROLE_CONTROLLING; | 589 : ICEROLE_CONTROLLING; |
| 590 for (const auto& kv : transports_) { | 590 for (const auto& kv : transports_) { |
| 591 kv.second->SetIceRole(reversed_role); | 591 kv.second->SetIceRole(reversed_role); |
| 592 } | 592 } |
| 593 } | 593 } |
| 594 | 594 |
| 595 void TransportController::OnChannelConnectionRemoved_n( | 595 void TransportController::OnChannelStateChanged_n( |
| 596 TransportChannelImpl* channel) { | 596 TransportChannelImpl* channel) { |
| 597 RTC_DCHECK(network_thread_->IsCurrent()); | 597 RTC_DCHECK(network_thread_->IsCurrent()); |
| 598 LOG(LS_INFO) << channel->transport_name() << " TransportChannel " | 598 LOG(LS_INFO) << channel->transport_name() << " TransportChannel " |
| 599 << channel->component() | 599 << channel->component() |
| 600 << " connection removed. Check if state is complete."; | 600 << " state changed. Check if state is complete."; |
| 601 UpdateAggregateStates_n(); | 601 UpdateAggregateStates_n(); |
| 602 } | 602 } |
| 603 | 603 |
| 604 void TransportController::UpdateAggregateStates_n() { | 604 void TransportController::UpdateAggregateStates_n() { |
| 605 RTC_DCHECK(network_thread_->IsCurrent()); | 605 RTC_DCHECK(network_thread_->IsCurrent()); |
| 606 | 606 |
| 607 IceConnectionState new_connection_state = kIceConnectionConnecting; | 607 IceConnectionState new_connection_state = kIceConnectionConnecting; |
| 608 IceGatheringState new_gathering_state = kIceGatheringNew; | 608 IceGatheringState new_gathering_state = kIceGatheringNew; |
| 609 bool any_receiving = false; | 609 bool any_receiving = false; |
| 610 bool any_failed = false; | 610 bool any_failed = false; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 655 } | 655 } |
| 656 if (gathering_state_ != new_gathering_state) { | 656 if (gathering_state_ != new_gathering_state) { |
| 657 gathering_state_ = new_gathering_state; | 657 gathering_state_ = new_gathering_state; |
| 658 signaling_thread_->Post( | 658 signaling_thread_->Post( |
| 659 this, MSG_ICEGATHERINGSTATE, | 659 this, MSG_ICEGATHERINGSTATE, |
| 660 new rtc::TypedMessageData<IceGatheringState>(new_gathering_state)); | 660 new rtc::TypedMessageData<IceGatheringState>(new_gathering_state)); |
| 661 } | 661 } |
| 662 } | 662 } |
| 663 | 663 |
| 664 } // namespace cricket | 664 } // namespace cricket |
| OLD | NEW |