Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(579)

Side by Side Diff: webrtc/api/webrtcsession.cc

Issue 1975453002: Add PeerConnection IsClosed check. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Minor Changes. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1457 matching lines...) Expand 10 before | Expand all | Expand 10 after
1468 LOG(LS_INFO) << "Changing IceConnectionState " << ice_connection_state_ 1468 LOG(LS_INFO) << "Changing IceConnectionState " << ice_connection_state_
1469 << " => " << state; 1469 << " => " << state;
1470 RTC_DCHECK(ice_connection_state_ != 1470 RTC_DCHECK(ice_connection_state_ !=
1471 PeerConnectionInterface::kIceConnectionClosed); 1471 PeerConnectionInterface::kIceConnectionClosed);
1472 ice_connection_state_ = state; 1472 ice_connection_state_ = state;
1473 if (ice_observer_) { 1473 if (ice_observer_) {
1474 ice_observer_->OnIceConnectionChange(ice_connection_state_); 1474 ice_observer_->OnIceConnectionChange(ice_connection_state_);
1475 } 1475 }
1476 } 1476 }
1477 1477
1478 void WebRtcSession::SetTransportController(
1479 cricket::TransportController* transport_controller) {
Taylor Brandstetter 2016/06/21 23:50:02 Could we just pass the TransportController into th
Zhi Huang 2016/06/22 22:01:09 This is a good point. I can do this.
1480 transport_controller_.reset(transport_controller);
1481 transport_controller_->SetIceRole(cricket::ICEROLE_CONTROLLED);
1482 transport_controller_->SignalConnectionState.connect(
1483 this, &WebRtcSession::OnTransportControllerConnectionState);
1484 transport_controller_->SignalReceiving.connect(
1485 this, &WebRtcSession::OnTransportControllerReceiving);
1486 transport_controller_->SignalGatheringState.connect(
1487 this, &WebRtcSession::OnTransportControllerGatheringState);
1488 transport_controller_->SignalCandidatesGathered.connect(
1489 this, &WebRtcSession::OnTransportControllerCandidatesGathered);
1490 transport_controller_->SignalCandidatesRemoved.connect(
1491 this, &WebRtcSession::OnTransportControllerCandidatesRemoved);
1492 }
1493
1478 void WebRtcSession::OnTransportControllerConnectionState( 1494 void WebRtcSession::OnTransportControllerConnectionState(
1479 cricket::IceConnectionState state) { 1495 cricket::IceConnectionState state) {
1480 switch (state) { 1496 switch (state) {
1481 case cricket::kIceConnectionConnecting: 1497 case cricket::kIceConnectionConnecting:
1482 // If the current state is Connected or Completed, then there were 1498 // If the current state is Connected or Completed, then there were
1483 // writable channels but now there are not, so the next state must 1499 // writable channels but now there are not, so the next state must
1484 // be Disconnected. 1500 // be Disconnected.
1485 // kIceConnectionConnecting is currently used as the default, 1501 // kIceConnectionConnecting is currently used as the default,
1486 // un-connected state by the TransportController, so its only use is 1502 // un-connected state by the TransportController, so its only use is
1487 // detecting disconnections. 1503 // detecting disconnections.
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after
2155 ssl_cipher_suite); 2171 ssl_cipher_suite);
2156 } 2172 }
2157 } 2173 }
2158 2174
2159 void WebRtcSession::OnSentPacket_w(const rtc::SentPacket& sent_packet) { 2175 void WebRtcSession::OnSentPacket_w(const rtc::SentPacket& sent_packet) {
2160 RTC_DCHECK(worker_thread()->IsCurrent()); 2176 RTC_DCHECK(worker_thread()->IsCurrent());
2161 media_controller_->call_w()->OnSentPacket(sent_packet); 2177 media_controller_->call_w()->OnSentPacket(sent_packet);
2162 } 2178 }
2163 2179
2164 } // namespace webrtc 2180 } // namespace webrtc
OLDNEW
« webrtc/api/peerconnectioninterface_unittest.cc ('K') | « webrtc/api/webrtcsession.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698