Add one more BasicPortAllocator constructor

The new constructor takes a NetworkManager and a list of turn servers.
Intended to aid migration away from using the constructor with
additional relay addresses.

Bug: webrtc:10947
Change-Id: If8dcdc24090cc35b929646bc78aa646e8135e4cd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/151641
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29095}
This commit is contained in:
Niels Möller
2019-09-06 10:29:50 +02:00
committed by Commit Bot
parent cc7ea18676
commit a3baf2a3b1
2 changed files with 8 additions and 1 deletions

View File

@ -173,13 +173,18 @@ BasicPortAllocator::BasicPortAllocator(rtc::NetworkManager* network_manager)
Construct();
}
BasicPortAllocator::BasicPortAllocator(rtc::NetworkManager* network_manager,
const ServerAddresses& stun_servers)
: BasicPortAllocator(network_manager,
/*socket_factory=*/nullptr,
stun_servers) {}
BasicPortAllocator::BasicPortAllocator(rtc::NetworkManager* network_manager,
rtc::PacketSocketFactory* socket_factory,
const ServerAddresses& stun_servers)
: network_manager_(network_manager), socket_factory_(socket_factory) {
InitRelayPortFactory(nullptr);
RTC_DCHECK(relay_port_factory_ != nullptr);
RTC_DCHECK(socket_factory_ != NULL);
SetConfiguration(stun_servers, std::vector<RelayServerConfig>(), 0, false,
nullptr);
Construct();

View File

@ -36,6 +36,8 @@ class RTC_EXPORT BasicPortAllocator : public PortAllocator {
webrtc::TurnCustomizer* customizer = nullptr,
RelayPortFactoryInterface* relay_port_factory = nullptr);
explicit BasicPortAllocator(rtc::NetworkManager* network_manager);
BasicPortAllocator(rtc::NetworkManager* network_manager,
const ServerAddresses& stun_servers);
BasicPortAllocator(rtc::NetworkManager* network_manager,
rtc::PacketSocketFactory* socket_factory,
const ServerAddresses& stun_servers);