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

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

Issue 1397973002: Merging BaseSession code into WebRtcSession. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Removing obsolete unit test. Created 5 years, 2 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 * 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 768 matching lines...) Expand 10 before | Expand all | Expand 10 after
779 } 779 }
780 780
781 void PeerConnection::Close() { 781 void PeerConnection::Close() {
782 // Update stats here so that we have the most recent stats for tracks and 782 // Update stats here so that we have the most recent stats for tracks and
783 // streams before the channels are closed. 783 // streams before the channels are closed.
784 stats_->UpdateStats(kStatsOutputLevelStandard); 784 stats_->UpdateStats(kStatsOutputLevelStandard);
785 785
786 session_->Terminate(); 786 session_->Terminate();
787 } 787 }
788 788
789 void PeerConnection::OnSessionStateChange(cricket::BaseSession* /*session*/, 789 void PeerConnection::OnSessionStateChange(WebRtcSession* /*session*/,
790 cricket::BaseSession::State state) { 790 WebRtcSession::State state) {
791 switch (state) { 791 switch (state) {
792 case cricket::BaseSession::STATE_INIT: 792 case WebRtcSession::STATE_INIT:
793 ChangeSignalingState(PeerConnectionInterface::kStable); 793 ChangeSignalingState(PeerConnectionInterface::kStable);
794 break; 794 break;
795 case cricket::BaseSession::STATE_SENTINITIATE: 795 case WebRtcSession::STATE_SENTINITIATE:
796 ChangeSignalingState(PeerConnectionInterface::kHaveLocalOffer); 796 ChangeSignalingState(PeerConnectionInterface::kHaveLocalOffer);
797 break; 797 break;
798 case cricket::BaseSession::STATE_SENTPRACCEPT: 798 case WebRtcSession::STATE_SENTPRACCEPT:
799 ChangeSignalingState(PeerConnectionInterface::kHaveLocalPrAnswer); 799 ChangeSignalingState(PeerConnectionInterface::kHaveLocalPrAnswer);
800 break; 800 break;
801 case cricket::BaseSession::STATE_RECEIVEDINITIATE: 801 case WebRtcSession::STATE_RECEIVEDINITIATE:
802 ChangeSignalingState(PeerConnectionInterface::kHaveRemoteOffer); 802 ChangeSignalingState(PeerConnectionInterface::kHaveRemoteOffer);
803 break; 803 break;
804 case cricket::BaseSession::STATE_RECEIVEDPRACCEPT: 804 case WebRtcSession::STATE_RECEIVEDPRACCEPT:
805 ChangeSignalingState(PeerConnectionInterface::kHaveRemotePrAnswer); 805 ChangeSignalingState(PeerConnectionInterface::kHaveRemotePrAnswer);
806 break; 806 break;
807 case cricket::BaseSession::STATE_SENTACCEPT: 807 case WebRtcSession::STATE_SENTACCEPT:
808 case cricket::BaseSession::STATE_RECEIVEDACCEPT: 808 case WebRtcSession::STATE_RECEIVEDACCEPT:
809 ChangeSignalingState(PeerConnectionInterface::kStable); 809 ChangeSignalingState(PeerConnectionInterface::kStable);
810 break; 810 break;
811 case cricket::BaseSession::STATE_RECEIVEDTERMINATE: 811 case WebRtcSession::STATE_RECEIVEDTERMINATE:
812 ChangeSignalingState(PeerConnectionInterface::kClosed); 812 ChangeSignalingState(PeerConnectionInterface::kClosed);
813 break; 813 break;
814 default: 814 default:
815 break; 815 break;
816 } 816 }
817 } 817 }
818 818
819 void PeerConnection::OnMessage(rtc::Message* msg) { 819 void PeerConnection::OnMessage(rtc::Message* msg) {
820 switch (msg->message_id) { 820 switch (msg->message_id) {
821 case MSG_SET_SESSIONDESCRIPTION_SUCCESS: { 821 case MSG_SET_SESSIONDESCRIPTION_SUCCESS: {
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
1010 std::vector<rtc::scoped_refptr<RtpReceiverInterface>>::iterator 1010 std::vector<rtc::scoped_refptr<RtpReceiverInterface>>::iterator
1011 PeerConnection::FindReceiverForTrack(MediaStreamTrackInterface* track) { 1011 PeerConnection::FindReceiverForTrack(MediaStreamTrackInterface* track) {
1012 return std::find_if( 1012 return std::find_if(
1013 receivers_.begin(), receivers_.end(), 1013 receivers_.begin(), receivers_.end(),
1014 [track](const rtc::scoped_refptr<RtpReceiverInterface>& receiver) { 1014 [track](const rtc::scoped_refptr<RtpReceiverInterface>& receiver) {
1015 return receiver->track() == track; 1015 return receiver->track() == track;
1016 }); 1016 });
1017 } 1017 }
1018 1018
1019 } // namespace webrtc 1019 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698