Delete deprecated PeerConnection methods, and corresponding using declarations.
BUG=None
Review-Url: https://codereview.webrtc.org/2632203003
Cr-Original-Commit-Position: refs/heads/master@{#17120}
Cr-Mirrored-From: https://chromium.googlesource.com/external/webrtc
Cr-Mirrored-Commit: 7f067663acc38e6c2ca8502947c0a1353601f387
diff --git a/api/peerconnectioninterface.h b/api/peerconnectioninterface.h
index d9d6c89..b346783 100644
--- a/api/peerconnectioninterface.h
+++ b/api/peerconnectioninterface.h
@@ -518,9 +518,6 @@
// 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 @@
// with.
virtual rtc::scoped_refptr<RtpSenderInterface> AddTrack(
MediaStreamTrackInterface* track,
- std::vector<MediaStreamInterface*> streams) {
- return nullptr;
- }
+ std::vector<MediaStreamInterface*> 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 @@
// pointer version.
// Triggered when media is received on a new stream from remote peer.
- virtual void OnAddStream(rtc::scoped_refptr<MediaStreamInterface> stream) {}
- // Deprecated; please use the version that uses a scoped_refptr.
- virtual void OnAddStream(MediaStreamInterface* stream) {}
+ virtual void OnAddStream(rtc::scoped_refptr<MediaStreamInterface> stream) = 0;
// Triggered when a remote peer close a stream.
- virtual void OnRemoveStream(rtc::scoped_refptr<MediaStreamInterface> stream) {
- }
- // Deprecated; please use the version that uses a scoped_refptr.
- virtual void OnRemoveStream(MediaStreamInterface* stream) {}
+ virtual void OnRemoveStream(
+ rtc::scoped_refptr<MediaStreamInterface> stream) = 0;
// Triggered when a remote peer opens a data channel.
virtual void OnDataChannel(
- rtc::scoped_refptr<DataChannelInterface> data_channel) {}
- // Deprecated; please use the version that uses a scoped_refptr.
- virtual void OnDataChannel(DataChannelInterface* data_channel) {}
+ rtc::scoped_refptr<DataChannelInterface> data_channel) = 0;
// Triggered when renegotiation is needed. For example, an ICE restart
// has begun.
diff --git a/pc/peerconnection.cc b/pc/peerconnection.cc
index 3f01d69..c5d6591 100644
--- a/pc/peerconnection.cc
+++ b/pc/peerconnection.cc
@@ -1363,9 +1363,6 @@
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<MediaStreamInterface>(new_stream));
}
@@ -2080,9 +2077,6 @@
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 @@
channel->SetReceiveSsrc(remote_ssrc);
rtc::scoped_refptr<DataChannelInterface> 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 @@
rtc::scoped_refptr<DataChannelInterface> 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/pc/peerconnection_unittest.cc b/pc/peerconnection_unittest.cc
index f62d30b..e5e310e 100644
--- a/pc/peerconnection_unittest.cc
+++ b/pc/peerconnection_unittest.cc
@@ -183,13 +183,6 @@
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/pc/peerconnectionfactory_unittest.cc b/pc/peerconnectionfactory_unittest.cc
index 9a6e543..10aacc0 100644
--- a/pc/peerconnectionfactory_unittest.cc
+++ b/pc/peerconnectionfactory_unittest.cc
@@ -63,13 +63,6 @@
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/pc/peerconnectioninterface_unittest.cc b/pc/peerconnectioninterface_unittest.cc
index 8a80e5e..02c7932 100644
--- a/pc/peerconnectioninterface_unittest.cc
+++ b/pc/peerconnectioninterface_unittest.cc
@@ -526,13 +526,6 @@
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/pc/test/peerconnectiontestwrapper.h b/pc/test/peerconnectiontestwrapper.h
index b761b05..6b7fd5e 100644
--- a/pc/test/peerconnectiontestwrapper.h
+++ b/pc/test/peerconnectiontestwrapper.h
@@ -24,13 +24,6 @@
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/sdk/android/src/jni/peerconnection_jni.cc b/sdk/android/src/jni/peerconnection_jni.cc
index e28641a..75b1bad 100644
--- a/sdk/android/src/jni/peerconnection_jni.cc
+++ b/sdk/android/src/jni/peerconnection_jni.cc
@@ -206,13 +206,6 @@
// 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_)),