From 6b1d626b043cea37d01b6a72ca1086fe4680a052 Mon Sep 17 00:00:00 2001 From: Tommi Date: Sun, 10 Apr 2022 14:02:23 +0200 Subject: [PATCH] Remove deprecated ProxyConnection ctor and make NewWeakPtr protected. Bug: webrtc:13892 Change-Id: Icad20a0f6d304c23106dd880f3bfd2c7142929c9 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258601 Reviewed-by: Niels Moller Commit-Queue: Tomas Gunnarsson Cr-Commit-Position: refs/heads/main@{#36583} --- p2p/base/connection.cc | 5 ----- p2p/base/connection.h | 3 --- p2p/base/port.h | 5 ++--- 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/p2p/base/connection.cc b/p2p/base/connection.cc index 860b73cec7..25a4d012a9 100644 --- a/p2p/base/connection.cc +++ b/p2p/base/connection.cc @@ -1624,11 +1624,6 @@ ProxyConnection::ProxyConnection(rtc::WeakPtr port, const Candidate& remote_candidate) : Connection(std::move(port), index, remote_candidate) {} -ProxyConnection::ProxyConnection(Port* port, - size_t index, - const Candidate& remote_candidate) - : ProxyConnection(port->NewWeakPtr(), index, remote_candidate) {} - int ProxyConnection::Send(const void* data, size_t size, const rtc::PacketOptions& options) { diff --git a/p2p/base/connection.h b/p2p/base/connection.h index eb3ab2664e..e0f8ed4874 100644 --- a/p2p/base/connection.h +++ b/p2p/base/connection.h @@ -472,9 +472,6 @@ class ProxyConnection : public Connection { size_t index, const Candidate& remote_candidate); - // TODO(tommi): Remove this ctor once it's no longer needed. - ProxyConnection(Port* port, size_t index, const Candidate& remote_candidate); - int Send(const void* data, size_t size, const rtc::PacketOptions& options) override; diff --git a/p2p/base/port.h b/p2p/base/port.h index 33e9a53787..b1dab5e92b 100644 --- a/p2p/base/port.h +++ b/p2p/base/port.h @@ -381,9 +381,6 @@ class Port : public PortInterface, const std::string& relay_protocol, const rtc::SocketAddress& base_address); - // TODO(tommi): Make protected after updating ProxyConnection. - rtc::WeakPtr NewWeakPtr() { return weak_factory_.GetWeakPtr(); } - protected: enum { MSG_DESTROY_IF_DEAD = 0, MSG_FIRST_AVAILABLE }; @@ -391,6 +388,8 @@ class Port : public PortInterface, void set_type(const std::string& type) { type_ = type; } + rtc::WeakPtr NewWeakPtr() { return weak_factory_.GetWeakPtr(); } + void AddAddress(const rtc::SocketAddress& address, const rtc::SocketAddress& base_address, const rtc::SocketAddress& related_address,