From 7f067663acc38e6c2ca8502947c0a1353601f387 Mon Sep 17 00:00:00 2001 From: nisse Date: Wed, 8 Mar 2017 06:59:45 -0800 Subject: [PATCH] Delete deprecated PeerConnection methods, and corresponding using declarations. BUG=None Review-Url: https://codereview.webrtc.org/2632203003 Cr-Commit-Position: refs/heads/master@{#17120} --- webrtc/api/peerconnectioninterface.h | 25 +++++-------------- webrtc/pc/peerconnection.cc | 12 --------- webrtc/pc/peerconnection_unittest.cc | 7 ------ webrtc/pc/peerconnectionfactory_unittest.cc | 7 ------ webrtc/pc/peerconnectioninterface_unittest.cc | 7 ------ webrtc/pc/test/peerconnectiontestwrapper.h | 7 ------ .../sdk/android/src/jni/peerconnection_jni.cc | 7 ------ 7 files changed, 6 insertions(+), 66 deletions(-) diff --git a/webrtc/api/peerconnectioninterface.h b/webrtc/api/peerconnectioninterface.h index d9d6c89e29..b346783bb3 100644 --- a/webrtc/api/peerconnectioninterface.h +++ b/webrtc/api/peerconnectioninterface.h @@ -518,9 +518,6 @@ class PeerConnectionInterface : public rtc::RefCountInterface { // remote peer is notified. virtual void RemoveStream(MediaStreamInterface* stream) = 0; - // TODO(deadbeef): Make the following two methods pure virtual once - // implemented by all subclasses of PeerConnectionInterface. - // Add a new MediaStreamTrack to be sent on this PeerConnection, and return // the newly created RtpSender. // @@ -528,15 +525,11 @@ class PeerConnectionInterface : public rtc::RefCountInterface { // with. virtual rtc::scoped_refptr AddTrack( MediaStreamTrackInterface* track, - std::vector streams) { - return nullptr; - } + std::vector streams) = 0; // Remove an RtpSender from this PeerConnection. // Returns true on success. - virtual bool RemoveTrack(RtpSenderInterface* sender) { - return false; - } + virtual bool RemoveTrack(RtpSenderInterface* sender) = 0; // Returns pointer to a DtmfSender on success. Otherwise returns null. // @@ -780,21 +773,15 @@ class PeerConnectionObserver { // pointer version. // Triggered when media is received on a new stream from remote peer. - virtual void OnAddStream(rtc::scoped_refptr stream) {} - // Deprecated; please use the version that uses a scoped_refptr. - virtual void OnAddStream(MediaStreamInterface* stream) {} + virtual void OnAddStream(rtc::scoped_refptr stream) = 0; // Triggered when a remote peer close a stream. - virtual void OnRemoveStream(rtc::scoped_refptr stream) { - } - // Deprecated; please use the version that uses a scoped_refptr. - virtual void OnRemoveStream(MediaStreamInterface* stream) {} + virtual void OnRemoveStream( + rtc::scoped_refptr stream) = 0; // Triggered when a remote peer opens a data channel. virtual void OnDataChannel( - rtc::scoped_refptr data_channel) {} - // Deprecated; please use the version that uses a scoped_refptr. - virtual void OnDataChannel(DataChannelInterface* data_channel) {} + rtc::scoped_refptr data_channel) = 0; // Triggered when renegotiation is needed. For example, an ICE restart // has begun. diff --git a/webrtc/pc/peerconnection.cc b/webrtc/pc/peerconnection.cc index 3f01d69edf..c5d65918d9 100644 --- a/webrtc/pc/peerconnection.cc +++ b/webrtc/pc/peerconnection.cc @@ -1363,9 +1363,6 @@ void PeerConnection::SetRemoteDescription( for (size_t i = 0; i < new_streams->count(); ++i) { MediaStreamInterface* new_stream = new_streams->at(i); stats_->AddStream(new_stream); - // Call both the raw pointer and scoped_refptr versions of the method - // for compatibility. - observer_->OnAddStream(new_stream); observer_->OnAddStream( rtc::scoped_refptr(new_stream)); } @@ -2080,9 +2077,6 @@ void PeerConnection::UpdateEndedRemoteMediaStreams() { for (auto& stream : streams_to_remove) { remote_streams_->RemoveStream(stream); - // Call both the raw pointer and scoped_refptr versions of the method - // for compatibility. - observer_->OnRemoveStream(stream.get()); observer_->OnRemoveStream(std::move(stream)); } } @@ -2257,9 +2251,6 @@ void PeerConnection::CreateRemoteRtpDataChannel(const std::string& label, channel->SetReceiveSsrc(remote_ssrc); rtc::scoped_refptr proxy_channel = DataChannelProxy::Create(signaling_thread(), channel); - // Call both the raw pointer and scoped_refptr versions of the method - // for compatibility. - observer_->OnDataChannel(proxy_channel.get()); observer_->OnDataChannel(std::move(proxy_channel)); } @@ -2416,9 +2407,6 @@ void PeerConnection::OnDataChannelOpenMessage( rtc::scoped_refptr proxy_channel = DataChannelProxy::Create(signaling_thread(), channel); - // Call both the raw pointer and scoped_refptr versions of the method - // for compatibility. - observer_->OnDataChannel(proxy_channel.get()); observer_->OnDataChannel(std::move(proxy_channel)); } diff --git a/webrtc/pc/peerconnection_unittest.cc b/webrtc/pc/peerconnection_unittest.cc index f62d30baf4..e5e310ea0f 100644 --- a/webrtc/pc/peerconnection_unittest.cc +++ b/webrtc/pc/peerconnection_unittest.cc @@ -183,13 +183,6 @@ class PeerConnectionTestClient : public webrtc::PeerConnectionObserver, public ObserverInterface, public rtc::MessageHandler { public: - // We need these using declarations because there are two versions of each of - // the below methods and we only override one of them. - // TODO(deadbeef): Remove once there's only one version of the methods. - using PeerConnectionObserver::OnAddStream; - using PeerConnectionObserver::OnRemoveStream; - using PeerConnectionObserver::OnDataChannel; - // If |config| is not provided, uses a default constructed RTCConfiguration. static PeerConnectionTestClient* CreateClientWithDtlsIdentityStore( const std::string& id, diff --git a/webrtc/pc/peerconnectionfactory_unittest.cc b/webrtc/pc/peerconnectionfactory_unittest.cc index 9a6e543105..10aacc0194 100644 --- a/webrtc/pc/peerconnectionfactory_unittest.cc +++ b/webrtc/pc/peerconnectionfactory_unittest.cc @@ -63,13 +63,6 @@ static const char kTurnIceServerWithIPv6Address[] = class NullPeerConnectionObserver : public PeerConnectionObserver { public: - // We need these using declarations because there are two versions of each of - // the below methods and we only override one of them. - // TODO(deadbeef): Remove once there's only one version of the methods. - using PeerConnectionObserver::OnAddStream; - using PeerConnectionObserver::OnRemoveStream; - using PeerConnectionObserver::OnDataChannel; - virtual ~NullPeerConnectionObserver() = default; void OnSignalingChange( PeerConnectionInterface::SignalingState new_state) override {} diff --git a/webrtc/pc/peerconnectioninterface_unittest.cc b/webrtc/pc/peerconnectioninterface_unittest.cc index 8a80e5e907..02c7932b37 100644 --- a/webrtc/pc/peerconnectioninterface_unittest.cc +++ b/webrtc/pc/peerconnectioninterface_unittest.cc @@ -526,13 +526,6 @@ class MockTrackObserver : public ObserverInterface { class MockPeerConnectionObserver : public PeerConnectionObserver { public: - // We need these using declarations because there are two versions of each of - // the below methods and we only override one of them. - // TODO(deadbeef): Remove once there's only one version of the methods. - using PeerConnectionObserver::OnAddStream; - using PeerConnectionObserver::OnRemoveStream; - using PeerConnectionObserver::OnDataChannel; - MockPeerConnectionObserver() : remote_streams_(StreamCollection::Create()) {} virtual ~MockPeerConnectionObserver() { } diff --git a/webrtc/pc/test/peerconnectiontestwrapper.h b/webrtc/pc/test/peerconnectiontestwrapper.h index b761b05fcd..6b7fd5e95b 100644 --- a/webrtc/pc/test/peerconnectiontestwrapper.h +++ b/webrtc/pc/test/peerconnectiontestwrapper.h @@ -24,13 +24,6 @@ class PeerConnectionTestWrapper public webrtc::CreateSessionDescriptionObserver, public sigslot::has_slots<> { public: - // We need these using declarations because there are two versions of each of - // the below methods and we only override one of them. - // TODO(deadbeef): Remove once there's only one version of the methods. - using PeerConnectionObserver::OnAddStream; - using PeerConnectionObserver::OnRemoveStream; - using PeerConnectionObserver::OnDataChannel; - static void Connect(PeerConnectionTestWrapper* caller, PeerConnectionTestWrapper* callee); diff --git a/webrtc/sdk/android/src/jni/peerconnection_jni.cc b/webrtc/sdk/android/src/jni/peerconnection_jni.cc index e28641a54d..75b1bad202 100644 --- a/webrtc/sdk/android/src/jni/peerconnection_jni.cc +++ b/webrtc/sdk/android/src/jni/peerconnection_jni.cc @@ -206,13 +206,6 @@ class ConstraintsWrapper; // and dispatches C++ callbacks to Java. class PCOJava : public PeerConnectionObserver { public: - // We need these using declarations because there are two versions of each of - // the below methods and we only override one of them. - // TODO(deadbeef): Remove once there's only one version of the methods. - using PeerConnectionObserver::OnAddStream; - using PeerConnectionObserver::OnRemoveStream; - using PeerConnectionObserver::OnDataChannel; - PCOJava(JNIEnv* jni, jobject j_observer) : j_observer_global_(jni, j_observer), j_observer_class_(jni, GetObjectClass(jni, *j_observer_global_)),