OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
861 stream_handler_container_->RemoveLocalTrack(stream, video_track); | 861 stream_handler_container_->RemoveLocalTrack(stream, video_track); |
862 } | 862 } |
863 | 863 |
864 void PeerConnection::OnRemoveLocalStream(MediaStreamInterface* stream) { | 864 void PeerConnection::OnRemoveLocalStream(MediaStreamInterface* stream) { |
865 stream_handler_container_->RemoveLocalStream(stream); | 865 stream_handler_container_->RemoveLocalStream(stream); |
866 } | 866 } |
867 | 867 |
868 void PeerConnection::OnIceConnectionChange( | 868 void PeerConnection::OnIceConnectionChange( |
869 PeerConnectionInterface::IceConnectionState new_state) { | 869 PeerConnectionInterface::IceConnectionState new_state) { |
870 ASSERT(signaling_thread()->IsCurrent()); | 870 ASSERT(signaling_thread()->IsCurrent()); |
| 871 // After transitioning to "closed", ignore any additional states from |
| 872 // WebRtcSession (such as "disconnected"). |
| 873 if (ice_connection_state_ == kIceConnectionClosed) { |
| 874 return; |
| 875 } |
871 ice_connection_state_ = new_state; | 876 ice_connection_state_ = new_state; |
872 observer_->OnIceConnectionChange(ice_connection_state_); | 877 observer_->OnIceConnectionChange(ice_connection_state_); |
873 } | 878 } |
874 | 879 |
875 void PeerConnection::OnIceGatheringChange( | 880 void PeerConnection::OnIceGatheringChange( |
876 PeerConnectionInterface::IceGatheringState new_state) { | 881 PeerConnectionInterface::IceGatheringState new_state) { |
877 ASSERT(signaling_thread()->IsCurrent()); | 882 ASSERT(signaling_thread()->IsCurrent()); |
878 if (IsClosed()) { | 883 if (IsClosed()) { |
879 return; | 884 return; |
880 } | 885 } |
(...skipping 25 matching lines...) Expand all Loading... |
906 if (ice_gathering_state_ != kIceGatheringComplete) { | 911 if (ice_gathering_state_ != kIceGatheringComplete) { |
907 ice_gathering_state_ = kIceGatheringComplete; | 912 ice_gathering_state_ = kIceGatheringComplete; |
908 observer_->OnIceGatheringChange(ice_gathering_state_); | 913 observer_->OnIceGatheringChange(ice_gathering_state_); |
909 } | 914 } |
910 } | 915 } |
911 observer_->OnSignalingChange(signaling_state_); | 916 observer_->OnSignalingChange(signaling_state_); |
912 observer_->OnStateChange(PeerConnectionObserver::kSignalingState); | 917 observer_->OnStateChange(PeerConnectionObserver::kSignalingState); |
913 } | 918 } |
914 | 919 |
915 } // namespace webrtc | 920 } // namespace webrtc |
OLD | NEW |