From cf08d339449463e99de30b1dd577c1c714371760 Mon Sep 17 00:00:00 2001 From: Jonas Oreland Date: Mon, 21 Mar 2022 15:47:27 +0100 Subject: [PATCH] Remove deprecated TurnPort::Create() versions Bug: webrtc:10335 Change-Id: I62eb0534ade2de221bc90c2f6c4f3caa0ac2e91b Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256266 Reviewed-by: Harald Alvestrand Commit-Queue: Jonas Oreland Cr-Commit-Position: refs/heads/main@{#36280} --- p2p/base/turn_port.h | 70 -------------------------------------------- 1 file changed, 70 deletions(-) diff --git a/p2p/base/turn_port.h b/p2p/base/turn_port.h index 7458871023..3328f2fcaa 100644 --- a/p2p/base/turn_port.h +++ b/p2p/base/turn_port.h @@ -104,76 +104,6 @@ class TurnPort : public Port { args.config->tls_cert_verifier, args.field_trials)); } - // Create a TURN port using the shared UDP socket, `socket`. - // TODO(jonaso) : remove in favor or CreateRelayPortArgs version. - static std::unique_ptr Create( - rtc::Thread* thread, - rtc::PacketSocketFactory* factory, - rtc::Network* network, - rtc::AsyncPacketSocket* socket, - const std::string& username, // ice username. - const std::string& password, // ice password. - const ProtocolAddress& server_address, - const RelayCredentials& credentials, - int server_priority, - webrtc::TurnCustomizer* customizer, - const webrtc::WebRtcKeyValueConfig* field_trials = nullptr) { - // Do basic parameter validation. - if (credentials.username.size() > kMaxTurnUsernameLength) { - RTC_LOG(LS_ERROR) << "Attempt to use TURN with a too long username " - << "of length " << credentials.username.size(); - return nullptr; - } - // Do not connect to low-numbered ports. The default STUN port is 3478. - if (!AllowedTurnPort(server_address.address.port(), field_trials)) { - RTC_LOG(LS_ERROR) << "Attempt to use TURN to connect to port " - << server_address.address.port(); - } - // Using `new` to access a non-public constructor. - return absl::WrapUnique(new TurnPort(thread, factory, network, socket, - username, password, server_address, - credentials, server_priority, {}, {}, - customizer, nullptr, field_trials)); - } - - // TODO(jonaso) : remove in favor or CreateRelayPortArgs version. - // Create a TURN port that will use a new socket, bound to `network` and - // using a port in the range between `min_port` and `max_port`. - static std::unique_ptr Create( - rtc::Thread* thread, - rtc::PacketSocketFactory* factory, - rtc::Network* network, - uint16_t min_port, - uint16_t max_port, - const std::string& username, // ice username. - const std::string& password, // ice password. - const ProtocolAddress& server_address, - const RelayCredentials& credentials, - int server_priority, - const std::vector& tls_alpn_protocols, - const std::vector& tls_elliptic_curves, - webrtc::TurnCustomizer* customizer, - rtc::SSLCertificateVerifier* tls_cert_verifier = nullptr, - const webrtc::WebRtcKeyValueConfig* field_trials = nullptr) { - // Do basic parameter validation. - if (credentials.username.size() > kMaxTurnUsernameLength) { - RTC_LOG(LS_ERROR) << "Attempt to use TURN with a too long username " - << "of length " << credentials.username.size(); - return nullptr; - } - // Do not connect to low-numbered ports. The default STUN port is 3478. - if (!AllowedTurnPort(server_address.address.port(), field_trials)) { - RTC_LOG(LS_ERROR) << "Attempt to use TURN to connect to port " - << server_address.address.port(); - return nullptr; - } - // Using `new` to access a non-public constructor. - return absl::WrapUnique(new TurnPort( - thread, factory, network, min_port, max_port, username, password, - server_address, credentials, server_priority, tls_alpn_protocols, - tls_elliptic_curves, customizer, tls_cert_verifier, field_trials)); - } - ~TurnPort() override; const ProtocolAddress& server_address() const { return server_address_; }