| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2012 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 1190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1201 session_->SetIceConfig(session_->ParseIceConfig(config)); | 1201 session_->SetIceConfig(session_->ParseIceConfig(config)); |
| 1202 return session_->SetIceTransports(config.type); | 1202 return session_->SetIceTransports(config.type); |
| 1203 } | 1203 } |
| 1204 | 1204 |
| 1205 bool PeerConnection::AddIceCandidate( | 1205 bool PeerConnection::AddIceCandidate( |
| 1206 const IceCandidateInterface* ice_candidate) { | 1206 const IceCandidateInterface* ice_candidate) { |
| 1207 TRACE_EVENT0("webrtc", "PeerConnection::AddIceCandidate"); | 1207 TRACE_EVENT0("webrtc", "PeerConnection::AddIceCandidate"); |
| 1208 return session_->ProcessIceMessage(ice_candidate); | 1208 return session_->ProcessIceMessage(ice_candidate); |
| 1209 } | 1209 } |
| 1210 | 1210 |
| 1211 bool PeerConnection::RemoveIceCandidates( |
| 1212 const std::vector<IceCandidateInterfaceRefPtr>& candidates) { |
| 1213 TRACE_EVENT0("webrtc", "PeerConnection::RemoveIceCandidates"); |
| 1214 return session_->RemoveRemoteIceCandidates(candidates); |
| 1215 } |
| 1216 |
| 1211 void PeerConnection::RegisterUMAObserver(UMAObserver* observer) { | 1217 void PeerConnection::RegisterUMAObserver(UMAObserver* observer) { |
| 1212 TRACE_EVENT0("webrtc", "PeerConnection::RegisterUmaObserver"); | 1218 TRACE_EVENT0("webrtc", "PeerConnection::RegisterUmaObserver"); |
| 1213 uma_observer_ = observer; | 1219 uma_observer_ = observer; |
| 1214 | 1220 |
| 1215 if (session_) { | 1221 if (session_) { |
| 1216 session_->set_metrics_observer(uma_observer_); | 1222 session_->set_metrics_observer(uma_observer_); |
| 1217 } | 1223 } |
| 1218 | 1224 |
| 1219 // Send information about IPv4/IPv6 status. | 1225 // Send information about IPv4/IPv6 status. |
| 1220 if (uma_observer_ && port_allocator_) { | 1226 if (uma_observer_ && port_allocator_) { |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1379 } | 1385 } |
| 1380 ice_gathering_state_ = new_state; | 1386 ice_gathering_state_ = new_state; |
| 1381 observer_->OnIceGatheringChange(ice_gathering_state_); | 1387 observer_->OnIceGatheringChange(ice_gathering_state_); |
| 1382 } | 1388 } |
| 1383 | 1389 |
| 1384 void PeerConnection::OnIceCandidate(const IceCandidateInterface* candidate) { | 1390 void PeerConnection::OnIceCandidate(const IceCandidateInterface* candidate) { |
| 1385 RTC_DCHECK(signaling_thread()->IsCurrent()); | 1391 RTC_DCHECK(signaling_thread()->IsCurrent()); |
| 1386 observer_->OnIceCandidate(candidate); | 1392 observer_->OnIceCandidate(candidate); |
| 1387 } | 1393 } |
| 1388 | 1394 |
| 1395 void PeerConnection::OnIceCandidatesRemoved( |
| 1396 const std::vector<IceCandidateInterfaceRefPtr>& candidates) { |
| 1397 RTC_DCHECK(signaling_thread()->IsCurrent()); |
| 1398 observer_->OnIceCandidatesRemoved(candidates); |
| 1399 } |
| 1400 |
| 1389 void PeerConnection::OnIceConnectionReceivingChange(bool receiving) { | 1401 void PeerConnection::OnIceConnectionReceivingChange(bool receiving) { |
| 1390 RTC_DCHECK(signaling_thread()->IsCurrent()); | 1402 RTC_DCHECK(signaling_thread()->IsCurrent()); |
| 1391 observer_->OnIceConnectionReceivingChange(receiving); | 1403 observer_->OnIceConnectionReceivingChange(receiving); |
| 1392 } | 1404 } |
| 1393 | 1405 |
| 1394 void PeerConnection::ChangeSignalingState( | 1406 void PeerConnection::ChangeSignalingState( |
| 1395 PeerConnectionInterface::SignalingState signaling_state) { | 1407 PeerConnectionInterface::SignalingState signaling_state) { |
| 1396 signaling_state_ = signaling_state; | 1408 signaling_state_ = signaling_state; |
| 1397 if (signaling_state == kClosed) { | 1409 if (signaling_state == kClosed) { |
| 1398 ice_connection_state_ = kIceConnectionClosed; | 1410 ice_connection_state_ = kIceConnectionClosed; |
| (...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2078 DataChannel* PeerConnection::FindDataChannelBySid(int sid) const { | 2090 DataChannel* PeerConnection::FindDataChannelBySid(int sid) const { |
| 2079 for (const auto& channel : sctp_data_channels_) { | 2091 for (const auto& channel : sctp_data_channels_) { |
| 2080 if (channel->id() == sid) { | 2092 if (channel->id() == sid) { |
| 2081 return channel; | 2093 return channel; |
| 2082 } | 2094 } |
| 2083 } | 2095 } |
| 2084 return nullptr; | 2096 return nullptr; |
| 2085 } | 2097 } |
| 2086 | 2098 |
| 2087 } // namespace webrtc | 2099 } // namespace webrtc |
| OLD | NEW |