| 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 1189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1200 session_->SetIceConfig(session_->ParseIceConfig(config)); | 1200 session_->SetIceConfig(session_->ParseIceConfig(config)); |
| 1201 return session_->SetIceTransports(config.type); | 1201 return session_->SetIceTransports(config.type); |
| 1202 } | 1202 } |
| 1203 | 1203 |
| 1204 bool PeerConnection::AddIceCandidate( | 1204 bool PeerConnection::AddIceCandidate( |
| 1205 const IceCandidateInterface* ice_candidate) { | 1205 const IceCandidateInterface* ice_candidate) { |
| 1206 TRACE_EVENT0("webrtc", "PeerConnection::AddIceCandidate"); | 1206 TRACE_EVENT0("webrtc", "PeerConnection::AddIceCandidate"); |
| 1207 return session_->ProcessIceMessage(ice_candidate); | 1207 return session_->ProcessIceMessage(ice_candidate); |
| 1208 } | 1208 } |
| 1209 | 1209 |
| 1210 bool PeerConnection::RemoveIceCandidates( | |
| 1211 const std::vector<cricket::Candidate>& candidates) { | |
| 1212 TRACE_EVENT0("webrtc", "PeerConnection::RemoveIceCandidates"); | |
| 1213 return session_->RemoveRemoteIceCandidates(candidates); | |
| 1214 } | |
| 1215 | |
| 1216 void PeerConnection::RegisterUMAObserver(UMAObserver* observer) { | 1210 void PeerConnection::RegisterUMAObserver(UMAObserver* observer) { |
| 1217 TRACE_EVENT0("webrtc", "PeerConnection::RegisterUmaObserver"); | 1211 TRACE_EVENT0("webrtc", "PeerConnection::RegisterUmaObserver"); |
| 1218 uma_observer_ = observer; | 1212 uma_observer_ = observer; |
| 1219 | 1213 |
| 1220 if (session_) { | 1214 if (session_) { |
| 1221 session_->set_metrics_observer(uma_observer_); | 1215 session_->set_metrics_observer(uma_observer_); |
| 1222 } | 1216 } |
| 1223 | 1217 |
| 1224 // Send information about IPv4/IPv6 status. | 1218 // Send information about IPv4/IPv6 status. |
| 1225 if (uma_observer_ && port_allocator_) { | 1219 if (uma_observer_ && port_allocator_) { |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1384 } | 1378 } |
| 1385 ice_gathering_state_ = new_state; | 1379 ice_gathering_state_ = new_state; |
| 1386 observer_->OnIceGatheringChange(ice_gathering_state_); | 1380 observer_->OnIceGatheringChange(ice_gathering_state_); |
| 1387 } | 1381 } |
| 1388 | 1382 |
| 1389 void PeerConnection::OnIceCandidate(const IceCandidateInterface* candidate) { | 1383 void PeerConnection::OnIceCandidate(const IceCandidateInterface* candidate) { |
| 1390 RTC_DCHECK(signaling_thread()->IsCurrent()); | 1384 RTC_DCHECK(signaling_thread()->IsCurrent()); |
| 1391 observer_->OnIceCandidate(candidate); | 1385 observer_->OnIceCandidate(candidate); |
| 1392 } | 1386 } |
| 1393 | 1387 |
| 1394 void PeerConnection::OnIceCandidatesRemoved( | |
| 1395 const std::vector<cricket::Candidate>& candidates) { | |
| 1396 RTC_DCHECK(signaling_thread()->IsCurrent()); | |
| 1397 observer_->OnIceCandidatesRemoved(candidates); | |
| 1398 } | |
| 1399 | |
| 1400 void PeerConnection::OnIceConnectionReceivingChange(bool receiving) { | 1388 void PeerConnection::OnIceConnectionReceivingChange(bool receiving) { |
| 1401 RTC_DCHECK(signaling_thread()->IsCurrent()); | 1389 RTC_DCHECK(signaling_thread()->IsCurrent()); |
| 1402 observer_->OnIceConnectionReceivingChange(receiving); | 1390 observer_->OnIceConnectionReceivingChange(receiving); |
| 1403 } | 1391 } |
| 1404 | 1392 |
| 1405 void PeerConnection::ChangeSignalingState( | 1393 void PeerConnection::ChangeSignalingState( |
| 1406 PeerConnectionInterface::SignalingState signaling_state) { | 1394 PeerConnectionInterface::SignalingState signaling_state) { |
| 1407 signaling_state_ = signaling_state; | 1395 signaling_state_ = signaling_state; |
| 1408 if (signaling_state == kClosed) { | 1396 if (signaling_state == kClosed) { |
| 1409 ice_connection_state_ = kIceConnectionClosed; | 1397 ice_connection_state_ = kIceConnectionClosed; |
| (...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2124 DataChannel* PeerConnection::FindDataChannelBySid(int sid) const { | 2112 DataChannel* PeerConnection::FindDataChannelBySid(int sid) const { |
| 2125 for (const auto& channel : sctp_data_channels_) { | 2113 for (const auto& channel : sctp_data_channels_) { |
| 2126 if (channel->id() == sid) { | 2114 if (channel->id() == sid) { |
| 2127 return channel; | 2115 return channel; |
| 2128 } | 2116 } |
| 2129 } | 2117 } |
| 2130 return nullptr; | 2118 return nullptr; |
| 2131 } | 2119 } |
| 2132 | 2120 |
| 2133 } // namespace webrtc | 2121 } // namespace webrtc |
| OLD | NEW |