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_;