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

Side by Side Diff: talk/app/webrtc/peerconnection.cc

Issue 1358413003: Revert of TransportController refactoring. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « talk/app/webrtc/objctests/RTCPeerConnectionTest.mm ('k') | talk/app/webrtc/statscollector.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 598 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 // Update stats here so that we have the most recent stats for tracks and 609 // Update stats here so that we have the most recent stats for tracks and
610 // streams that might be removed by updating the session description. 610 // streams that might be removed by updating the session description.
611 stats_->UpdateStats(kStatsOutputLevelStandard); 611 stats_->UpdateStats(kStatsOutputLevelStandard);
612 std::string error; 612 std::string error;
613 if (!session_->SetLocalDescription(desc, &error)) { 613 if (!session_->SetLocalDescription(desc, &error)) {
614 PostSetSessionDescriptionFailure(observer, error); 614 PostSetSessionDescriptionFailure(observer, error);
615 return; 615 return;
616 } 616 }
617 SetSessionDescriptionMsg* msg = new SetSessionDescriptionMsg(observer); 617 SetSessionDescriptionMsg* msg = new SetSessionDescriptionMsg(observer);
618 signaling_thread()->Post(this, MSG_SET_SESSIONDESCRIPTION_SUCCESS, msg); 618 signaling_thread()->Post(this, MSG_SET_SESSIONDESCRIPTION_SUCCESS, msg);
619 // MaybeStartGathering needs to be called after posting
620 // MSG_SET_SESSIONDESCRIPTION_SUCCESS, so that we don't signal any candidates
621 // before signaling that SetLocalDescription completed.
622 session_->MaybeStartGathering();
623 } 619 }
624 620
625 void PeerConnection::SetRemoteDescription( 621 void PeerConnection::SetRemoteDescription(
626 SetSessionDescriptionObserver* observer, 622 SetSessionDescriptionObserver* observer,
627 SessionDescriptionInterface* desc) { 623 SessionDescriptionInterface* desc) {
628 if (!VERIFY(observer != NULL)) { 624 if (!VERIFY(observer != NULL)) {
629 LOG(LS_ERROR) << "SetRemoteDescription - observer is NULL."; 625 LOG(LS_ERROR) << "SetRemoteDescription - observer is NULL.";
630 return; 626 return;
631 } 627 }
632 if (!desc) { 628 if (!desc) {
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
865 stream_handler_container_->RemoveLocalTrack(stream, video_track); 861 stream_handler_container_->RemoveLocalTrack(stream, video_track);
866 } 862 }
867 863
868 void PeerConnection::OnRemoveLocalStream(MediaStreamInterface* stream) { 864 void PeerConnection::OnRemoveLocalStream(MediaStreamInterface* stream) {
869 stream_handler_container_->RemoveLocalStream(stream); 865 stream_handler_container_->RemoveLocalStream(stream);
870 } 866 }
871 867
872 void PeerConnection::OnIceConnectionChange( 868 void PeerConnection::OnIceConnectionChange(
873 PeerConnectionInterface::IceConnectionState new_state) { 869 PeerConnectionInterface::IceConnectionState new_state) {
874 ASSERT(signaling_thread()->IsCurrent()); 870 ASSERT(signaling_thread()->IsCurrent());
875 // After transitioning to "closed", ignore any additional states from
876 // WebRtcSession (such as "disconnected").
877 if (ice_connection_state_ == kIceConnectionClosed) {
878 return;
879 }
880 ice_connection_state_ = new_state; 871 ice_connection_state_ = new_state;
881 observer_->OnIceConnectionChange(ice_connection_state_); 872 observer_->OnIceConnectionChange(ice_connection_state_);
882 } 873 }
883 874
884 void PeerConnection::OnIceGatheringChange( 875 void PeerConnection::OnIceGatheringChange(
885 PeerConnectionInterface::IceGatheringState new_state) { 876 PeerConnectionInterface::IceGatheringState new_state) {
886 ASSERT(signaling_thread()->IsCurrent()); 877 ASSERT(signaling_thread()->IsCurrent());
887 if (IsClosed()) { 878 if (IsClosed()) {
888 return; 879 return;
889 } 880 }
(...skipping 25 matching lines...) Expand all
915 if (ice_gathering_state_ != kIceGatheringComplete) { 906 if (ice_gathering_state_ != kIceGatheringComplete) {
916 ice_gathering_state_ = kIceGatheringComplete; 907 ice_gathering_state_ = kIceGatheringComplete;
917 observer_->OnIceGatheringChange(ice_gathering_state_); 908 observer_->OnIceGatheringChange(ice_gathering_state_);
918 } 909 }
919 } 910 }
920 observer_->OnSignalingChange(signaling_state_); 911 observer_->OnSignalingChange(signaling_state_);
921 observer_->OnStateChange(PeerConnectionObserver::kSignalingState); 912 observer_->OnStateChange(PeerConnectionObserver::kSignalingState);
922 } 913 }
923 914
924 } // namespace webrtc 915 } // namespace webrtc
OLDNEW
« no previous file with comments | « talk/app/webrtc/objctests/RTCPeerConnectionTest.mm ('k') | talk/app/webrtc/statscollector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698