From fabe2c961f9cf86d519532a96e96fa7d6c4ca37d Mon Sep 17 00:00:00 2001 From: jbauch Date: Thu, 16 Jul 2015 13:43:14 -0700 Subject: [PATCH] Remove deprecated functions. This CL removes some functions that are marked as deprecated. Chromium has been updated in https://crrev.com/7dee3f68b7699ad72c7fc4d75332f72703313849 to call the new functions. Review URL: https://codereview.webrtc.org/1237613003 Cr-Commit-Position: refs/heads/master@{#9598} --- talk/app/webrtc/jsep.h | 9 --------- talk/app/webrtc/jsepicecandidate.cc | 6 ------ talk/app/webrtc/jsepsessiondescription.cc | 5 ----- talk/app/webrtc/objc/RTCICECandidate.mm | 3 ++- .../peerconnectioninterface_unittest.cc | 7 ++++--- talk/app/webrtc/webrtcsession_unittest.cc | 3 ++- .../peerconnection/client/conductor.cc | 14 +++++++++----- talk/media/base/streamparams.h | 19 ------------------- 8 files changed, 17 insertions(+), 49 deletions(-) diff --git a/talk/app/webrtc/jsep.h b/talk/app/webrtc/jsep.h index e484ec4e20..c12ab85f34 100644 --- a/talk/app/webrtc/jsep.h +++ b/talk/app/webrtc/jsep.h @@ -71,11 +71,6 @@ class IceCandidateInterface { // Creates a IceCandidateInterface based on SDP string. // Returns NULL if the sdp string can't be parsed. -// TODO(ronghuawu): Deprecated. -IceCandidateInterface* CreateIceCandidate(const std::string& sdp_mid, - int sdp_mline_index, - const std::string& sdp); - // |error| can be NULL if doesn't care about the failure reason. IceCandidateInterface* CreateIceCandidate(const std::string& sdp_mid, int sdp_mline_index, @@ -128,10 +123,6 @@ class SessionDescriptionInterface { // Creates a SessionDescriptionInterface based on SDP string and the type. // Returns NULL if the sdp string can't be parsed or the type is unsupported. -// TODO(ronghuawu): Deprecated. -SessionDescriptionInterface* CreateSessionDescription(const std::string& type, - const std::string& sdp); - // |error| can be NULL if doesn't care about the failure reason. SessionDescriptionInterface* CreateSessionDescription(const std::string& type, const std::string& sdp, diff --git a/talk/app/webrtc/jsepicecandidate.cc b/talk/app/webrtc/jsepicecandidate.cc index 68e696ebdb..768bd0a281 100644 --- a/talk/app/webrtc/jsepicecandidate.cc +++ b/talk/app/webrtc/jsepicecandidate.cc @@ -34,12 +34,6 @@ namespace webrtc { -IceCandidateInterface* CreateIceCandidate(const std::string& sdp_mid, - int sdp_mline_index, - const std::string& sdp) { - return CreateIceCandidate(sdp_mid, sdp_mline_index, sdp, NULL); -} - IceCandidateInterface* CreateIceCandidate(const std::string& sdp_mid, int sdp_mline_index, const std::string& sdp, diff --git a/talk/app/webrtc/jsepsessiondescription.cc b/talk/app/webrtc/jsepsessiondescription.cc index d1428d000c..24bd9d4195 100644 --- a/talk/app/webrtc/jsepsessiondescription.cc +++ b/talk/app/webrtc/jsepsessiondescription.cc @@ -75,11 +75,6 @@ const int JsepSessionDescription::kMaxVideoCodecHeight = 1080; #endif const int JsepSessionDescription::kDefaultVideoCodecPreference = 1; -SessionDescriptionInterface* CreateSessionDescription(const std::string& type, - const std::string& sdp) { - return CreateSessionDescription(type, sdp, NULL); -} - SessionDescriptionInterface* CreateSessionDescription(const std::string& type, const std::string& sdp, SdpParseError* error) { diff --git a/talk/app/webrtc/objc/RTCICECandidate.mm b/talk/app/webrtc/objc/RTCICECandidate.mm index 54430ca5ac..1510946bac 100644 --- a/talk/app/webrtc/objc/RTCICECandidate.mm +++ b/talk/app/webrtc/objc/RTCICECandidate.mm @@ -80,7 +80,8 @@ - (const webrtc::IceCandidateInterface*)candidate { return webrtc::CreateIceCandidate( - [self.sdpMid UTF8String], self.sdpMLineIndex, [self.sdp UTF8String]); + [self.sdpMid UTF8String], self.sdpMLineIndex, [self.sdp UTF8String], + nullptr); } @end diff --git a/talk/app/webrtc/peerconnectioninterface_unittest.cc b/talk/app/webrtc/peerconnectioninterface_unittest.cc index a0e882664f..9e68f5a5b1 100644 --- a/talk/app/webrtc/peerconnectioninterface_unittest.cc +++ b/talk/app/webrtc/peerconnectioninterface_unittest.cc @@ -1101,7 +1101,7 @@ TEST_F(PeerConnectionInterfaceTest, ReceiveFireFoxOffer) { AddAudioVideoStream(kStreamLabel1, "audio_label", "video_label"); SessionDescriptionInterface* desc = webrtc::CreateSessionDescription(SessionDescriptionInterface::kOffer, - webrtc::kFireFoxSdpOffer); + webrtc::kFireFoxSdpOffer, nullptr); EXPECT_TRUE(DoSetSessionDescription(desc, false)); CreateAnswerAsLocalDescription(); ASSERT_TRUE(pc_->local_description() != NULL); @@ -1134,12 +1134,13 @@ TEST_F(PeerConnectionInterfaceTest, ReceiveUpdatedAudioOfferWithBadCodecs) { SessionDescriptionInterface* answer = webrtc::CreateSessionDescription(SessionDescriptionInterface::kAnswer, - webrtc::kAudioSdp); + webrtc::kAudioSdp, nullptr); EXPECT_TRUE(DoSetSessionDescription(answer, false)); SessionDescriptionInterface* updated_offer = webrtc::CreateSessionDescription(SessionDescriptionInterface::kOffer, - webrtc::kAudioSdpWithUnsupportedCodecs); + webrtc::kAudioSdpWithUnsupportedCodecs, + nullptr); EXPECT_TRUE(DoSetSessionDescription(updated_offer, false)); CreateAnswerAsLocalDescription(); } diff --git a/talk/app/webrtc/webrtcsession_unittest.cc b/talk/app/webrtc/webrtcsession_unittest.cc index f5931affdf..de10bc40a8 100644 --- a/talk/app/webrtc/webrtcsession_unittest.cc +++ b/talk/app/webrtc/webrtcsession_unittest.cc @@ -1085,7 +1085,8 @@ class WebRtcSessionTest : public testing::Test { std::string sdp; offer->ToString(&sdp); SessionDescriptionInterface* desc = - webrtc::CreateSessionDescription(JsepSessionDescription::kAnswer, sdp); + webrtc::CreateSessionDescription( + JsepSessionDescription::kAnswer, sdp, nullptr); ASSERT_TRUE(desc != NULL); SetRemoteDescriptionWithoutError(desc); diff --git a/talk/examples/peerconnection/client/conductor.cc b/talk/examples/peerconnection/client/conductor.cc index f30516fc74..72629cebfc 100644 --- a/talk/examples/peerconnection/client/conductor.cc +++ b/talk/examples/peerconnection/client/conductor.cc @@ -302,10 +302,12 @@ void Conductor::OnMessageFromPeer(int peer_id, const std::string& message) { LOG(WARNING) << "Can't parse received session description message."; return; } + webrtc::SdpParseError error; webrtc::SessionDescriptionInterface* session_description( - webrtc::CreateSessionDescription(type, sdp)); + webrtc::CreateSessionDescription(type, sdp, &error)); if (!session_description) { - LOG(WARNING) << "Can't parse received session description message."; + LOG(WARNING) << "Can't parse received session description message. " + << "SdpParseError was: " << error.description; return; } LOG(INFO) << " Received session description :" << message; @@ -328,10 +330,12 @@ void Conductor::OnMessageFromPeer(int peer_id, const std::string& message) { LOG(WARNING) << "Can't parse received message."; return; } + webrtc::SdpParseError error; rtc::scoped_ptr candidate( - webrtc::CreateIceCandidate(sdp_mid, sdp_mlineindex, sdp)); + webrtc::CreateIceCandidate(sdp_mid, sdp_mlineindex, sdp, &error)); if (!candidate.get()) { - LOG(WARNING) << "Can't parse received candidate message."; + LOG(WARNING) << "Can't parse received candidate message. " + << "SdpParseError was: " << error.description; return; } if (!peer_connection_->AddIceCandidate(candidate.get())) { @@ -536,7 +540,7 @@ void Conductor::OnSuccess(webrtc::SessionDescriptionInterface* desc) { if (loopback_) { // Replace message type from "offer" to "answer" webrtc::SessionDescriptionInterface* session_description( - webrtc::CreateSessionDescription("answer", sdp)); + webrtc::CreateSessionDescription("answer", sdp, nullptr)); peer_connection_->SetRemoteDescription( DummySetSessionDescriptionObserver::Create(), session_description); return; diff --git a/talk/media/base/streamparams.h b/talk/media/base/streamparams.h index 6e24fa3b96..a45289413f 100644 --- a/talk/media/base/streamparams.h +++ b/talk/media/base/streamparams.h @@ -303,25 +303,6 @@ inline const StreamParams* GetStream(const StreamParamsVec& streams, [&selector](const StreamParams& sp) { return selector.Matches(sp); }); } -//////////////////////////////////////////////////////////////////////////////// -// Deprecated methods that will be removed one of these days. -// Please use the methods with the same name above. -bool GetStream(const StreamParamsVec& streams, - const StreamSelector& selector, - StreamParams* stream_out); -inline bool GetStreamBySsrc(const StreamParamsVec& streams, uint32 ssrc, - StreamParams* stream_out) { - return GetStream(streams, StreamSelector(ssrc), stream_out); -} -inline bool GetStreamByIds(const StreamParamsVec& streams, - const std::string& groupid, - const std::string& id, - StreamParams* stream_out) { - return GetStream(streams, StreamSelector(groupid, id), stream_out); -} -// End deprecated methods. -//////////////////////////////////////////////////////////////////////////////// - template bool RemoveStream(StreamParamsVec* streams, Condition condition) { auto iter(std::remove_if(streams->begin(), streams->end(), condition));