| 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 1448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1459 WebRtcSession::certificate_for_testing() { | 1459 WebRtcSession::certificate_for_testing() { |
| 1460 return transport_controller_->certificate_for_testing(); | 1460 return transport_controller_->certificate_for_testing(); |
| 1461 } | 1461 } |
| 1462 | 1462 |
| 1463 void WebRtcSession::SetIceConnectionState( | 1463 void WebRtcSession::SetIceConnectionState( |
| 1464 PeerConnectionInterface::IceConnectionState state) { | 1464 PeerConnectionInterface::IceConnectionState state) { |
| 1465 if (ice_connection_state_ == state) { | 1465 if (ice_connection_state_ == state) { |
| 1466 return; | 1466 return; |
| 1467 } | 1467 } |
| 1468 | 1468 |
| 1469 // ASSERT that the requested transition is allowed. Note that | |
| 1470 // WebRtcSession does not implement "kIceConnectionClosed" (that is handled | |
| 1471 // within PeerConnection). This switch statement should compile away when | |
| 1472 // ASSERTs are disabled. | |
| 1473 LOG(LS_INFO) << "Changing IceConnectionState " << ice_connection_state_ | 1469 LOG(LS_INFO) << "Changing IceConnectionState " << ice_connection_state_ |
| 1474 << " => " << state; | 1470 << " => " << state; |
| 1475 switch (ice_connection_state_) { | 1471 RTC_DCHECK(ice_connection_state_ != |
| 1476 case PeerConnectionInterface::kIceConnectionNew: | 1472 PeerConnectionInterface::kIceConnectionClosed); |
| 1477 ASSERT(state == PeerConnectionInterface::kIceConnectionChecking); | |
| 1478 break; | |
| 1479 case PeerConnectionInterface::kIceConnectionChecking: | |
| 1480 ASSERT(state == PeerConnectionInterface::kIceConnectionFailed || | |
| 1481 state == PeerConnectionInterface::kIceConnectionConnected); | |
| 1482 break; | |
| 1483 case PeerConnectionInterface::kIceConnectionConnected: | |
| 1484 ASSERT(state == PeerConnectionInterface::kIceConnectionDisconnected || | |
| 1485 state == PeerConnectionInterface::kIceConnectionChecking || | |
| 1486 state == PeerConnectionInterface::kIceConnectionCompleted); | |
| 1487 break; | |
| 1488 case PeerConnectionInterface::kIceConnectionCompleted: | |
| 1489 ASSERT(state == PeerConnectionInterface::kIceConnectionConnected || | |
| 1490 state == PeerConnectionInterface::kIceConnectionDisconnected); | |
| 1491 break; | |
| 1492 case PeerConnectionInterface::kIceConnectionFailed: | |
| 1493 ASSERT(state == PeerConnectionInterface::kIceConnectionNew); | |
| 1494 break; | |
| 1495 case PeerConnectionInterface::kIceConnectionDisconnected: | |
| 1496 ASSERT(state == PeerConnectionInterface::kIceConnectionChecking || | |
| 1497 state == PeerConnectionInterface::kIceConnectionConnected || | |
| 1498 state == PeerConnectionInterface::kIceConnectionCompleted || | |
| 1499 state == PeerConnectionInterface::kIceConnectionFailed); | |
| 1500 break; | |
| 1501 case PeerConnectionInterface::kIceConnectionClosed: | |
| 1502 ASSERT(false); | |
| 1503 break; | |
| 1504 default: | |
| 1505 ASSERT(false); | |
| 1506 break; | |
| 1507 } | |
| 1508 | |
| 1509 ice_connection_state_ = state; | 1473 ice_connection_state_ = state; |
| 1510 if (ice_observer_) { | 1474 if (ice_observer_) { |
| 1511 ice_observer_->OnIceConnectionChange(ice_connection_state_); | 1475 ice_observer_->OnIceConnectionChange(ice_connection_state_); |
| 1512 } | 1476 } |
| 1513 } | 1477 } |
| 1514 | 1478 |
| 1515 void WebRtcSession::OnTransportControllerConnectionState( | 1479 void WebRtcSession::OnTransportControllerConnectionState( |
| 1516 cricket::IceConnectionState state) { | 1480 cricket::IceConnectionState state) { |
| 1517 switch (state) { | 1481 switch (state) { |
| 1518 case cricket::kIceConnectionConnecting: | 1482 case cricket::kIceConnectionConnecting: |
| (...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2192 ssl_cipher_suite); | 2156 ssl_cipher_suite); |
| 2193 } | 2157 } |
| 2194 } | 2158 } |
| 2195 | 2159 |
| 2196 void WebRtcSession::OnSentPacket_w(const rtc::SentPacket& sent_packet) { | 2160 void WebRtcSession::OnSentPacket_w(const rtc::SentPacket& sent_packet) { |
| 2197 RTC_DCHECK(worker_thread()->IsCurrent()); | 2161 RTC_DCHECK(worker_thread()->IsCurrent()); |
| 2198 media_controller_->call_w()->OnSentPacket(sent_packet); | 2162 media_controller_->call_w()->OnSentPacket(sent_packet); |
| 2199 } | 2163 } |
| 2200 | 2164 |
| 2201 } // namespace webrtc | 2165 } // namespace webrtc |
| OLD | NEW |