| 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 auto it = FindChannel_n(transport_name, component); | 180 auto it = FindChannel_n(transport_name, component); |
| 181 if (it != channels_.end()) { | 181 if (it != channels_.end()) { |
| 182 // Channel already exists; increment reference count and return. | 182 // Channel already exists; increment reference count and return. |
| 183 it->AddRef(); | 183 it->AddRef(); |
| 184 return it->get(); | 184 return it->get(); |
| 185 } | 185 } |
| 186 | 186 |
| 187 // Need to create a new channel. | 187 // Need to create a new channel. |
| 188 Transport* transport = GetOrCreateTransport_n(transport_name); | 188 Transport* transport = GetOrCreateTransport_n(transport_name); |
| 189 TransportChannelImpl* channel = transport->CreateChannel(component); | 189 TransportChannelImpl* channel = transport->CreateChannel(component); |
| 190 channel->SetMetricsObserver(metrics_observer_); |
| 190 channel->SignalWritableState.connect( | 191 channel->SignalWritableState.connect( |
| 191 this, &TransportController::OnChannelWritableState_n); | 192 this, &TransportController::OnChannelWritableState_n); |
| 192 channel->SignalReceivingState.connect( | 193 channel->SignalReceivingState.connect( |
| 193 this, &TransportController::OnChannelReceivingState_n); | 194 this, &TransportController::OnChannelReceivingState_n); |
| 194 channel->SignalGatheringState.connect( | 195 channel->SignalGatheringState.connect( |
| 195 this, &TransportController::OnChannelGatheringState_n); | 196 this, &TransportController::OnChannelGatheringState_n); |
| 196 channel->SignalCandidateGathered.connect( | 197 channel->SignalCandidateGathered.connect( |
| 197 this, &TransportController::OnChannelCandidateGathered_n); | 198 this, &TransportController::OnChannelCandidateGathered_n); |
| 198 channel->SignalCandidatesRemoved.connect( | 199 channel->SignalCandidatesRemoved.connect( |
| 199 this, &TransportController::OnChannelCandidatesRemoved_n); | 200 this, &TransportController::OnChannelCandidatesRemoved_n); |
| (...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 697 signaling_thread_->Post( | 698 signaling_thread_->Post( |
| 698 RTC_FROM_HERE, this, MSG_ICEGATHERINGSTATE, | 699 RTC_FROM_HERE, this, MSG_ICEGATHERINGSTATE, |
| 699 new rtc::TypedMessageData<IceGatheringState>(new_gathering_state)); | 700 new rtc::TypedMessageData<IceGatheringState>(new_gathering_state)); |
| 700 } | 701 } |
| 701 } | 702 } |
| 702 | 703 |
| 703 void TransportController::OnDtlsHandshakeError(rtc::SSLHandshakeError error) { | 704 void TransportController::OnDtlsHandshakeError(rtc::SSLHandshakeError error) { |
| 704 SignalDtlsHandshakeError(error); | 705 SignalDtlsHandshakeError(error); |
| 705 } | 706 } |
| 706 | 707 |
| 708 void TransportController::SetMetricsObserver( |
| 709 webrtc::MetricsObserverInterface* metrics_observer) { |
| 710 metrics_observer_ = metrics_observer; |
| 711 for (auto channel : channels_) { |
| 712 channel->SetMetricsObserver(metrics_observer); |
| 713 } |
| 714 } |
| 715 |
| 707 } // namespace cricket | 716 } // namespace cricket |
| OLD | NEW |