From 9582fa47dba991c75d2b804206de97cca38993a5 Mon Sep 17 00:00:00 2001 From: Harald Alvestrand Date: Tue, 4 May 2021 13:03:54 +0000 Subject: [PATCH] Remove unused setter for Port::socket_factory() Also take the opportunity to declare factory_ const. (Bug reference is where I noticed the possibility; it is unlikely to fix the bug.) Bug: chromium:1205343 Change-Id: I6078f170cf68d94314ee184bdfd2dc6f4ffc1e71 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/217385 Reviewed-by: Tommi Commit-Queue: Harald Alvestrand Cr-Commit-Position: refs/heads/master@{#33918} --- p2p/base/port.cc | 1 + p2p/base/port.h | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/p2p/base/port.cc b/p2p/base/port.cc index 79b83b7f2e..d24d40f957 100644 --- a/p2p/base/port.cc +++ b/p2p/base/port.cc @@ -137,6 +137,7 @@ Port::Port(rtc::Thread* thread, tiebreaker_(0), shared_socket_(true), weak_factory_(this) { + RTC_DCHECK(factory_ != NULL); Construct(); } diff --git a/p2p/base/port.h b/p2p/base/port.h index 66da9b841c..7759ade33b 100644 --- a/p2p/base/port.h +++ b/p2p/base/port.h @@ -218,9 +218,6 @@ class Port : public PortInterface, // The factory used to create the sockets of this port. rtc::PacketSocketFactory* socket_factory() const { return factory_; } - void set_socket_factory(rtc::PacketSocketFactory* factory) { - factory_ = factory; - } // For debugging purposes. const std::string& content_name() const { return content_name_; } @@ -445,7 +442,7 @@ class Port : public PortInterface, void OnNetworkTypeChanged(const rtc::Network* network); rtc::Thread* const thread_; - rtc::PacketSocketFactory* factory_; + rtc::PacketSocketFactory* const factory_; std::string type_; bool send_retransmit_count_attribute_; rtc::Network* network_;