Pass a SocketFactory to BasicNetworkManager constructor
Used by QueryDefaultLocalAddress, instead of relying on the update
thread's associated socket server.
This is not the only use of rtc::Thread::socketserver() in the
BasicNetworkManager class. It also interacts with the thread's
socket server to call set_network_binder. That is unchanged by this cl,
perhaps those calls can be moved to the caller of StartNetworkMonitor and
StopNetworkMonitor.
Bug: webrtc:13145
Change-Id: If109c2dcb0e74b183e10bb3db7a5aefcc95d1a8c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/232613
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35118}
diff --git a/rtc_base/nat_unittest.cc b/rtc_base/nat_unittest.cc
index e757bfd..4b7a117 100644
--- a/rtc_base/nat_unittest.cc
+++ b/rtc_base/nat_unittest.cc
@@ -219,7 +219,8 @@
}
void TestPhysicalInternal(const SocketAddress& int_addr) {
- BasicNetworkManager network_manager;
+ PhysicalSocketServer socket_server;
+ BasicNetworkManager network_manager(nullptr, &socket_server);
network_manager.StartUpdating();
// Process pending messages so the network list is updated.
Thread::Current()->ProcessMessages(0);