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