Remove the deprecated BasicNetworkManager constructor

Bug: webrtc:13145
Change-Id: I43696aea7256d3fe94a11514ea6d81e3c3ac5f57
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268780
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Daniel.L (Byoungchan) Lee <daniel.l@hpcnt.com>
Auto-Submit: Daniel.L (Byoungchan) Lee <daniel.l@hpcnt.com>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37564}
This commit is contained in:
Daniel.L (Byoungchan Lee) 2022-07-20 15:17:41 +09:00 committed by WebRTC LUCI CQ
parent 30c2a31309
commit 489f648ea3
2 changed files with 4 additions and 20 deletions

View file

@ -520,7 +520,9 @@ BasicNetworkManager::BasicNetworkManager(
allow_mac_based_ipv6_( allow_mac_based_ipv6_(
field_trials_->IsEnabled("WebRTC-AllowMACBasedIPv6")), field_trials_->IsEnabled("WebRTC-AllowMACBasedIPv6")),
bind_using_ifname_( bind_using_ifname_(
!field_trials_->IsDisabled("WebRTC-BindUsingInterfaceName")) {} !field_trials_->IsDisabled("WebRTC-BindUsingInterfaceName")) {
RTC_DCHECK(socket_factory_);
}
BasicNetworkManager::~BasicNetworkManager() { BasicNetworkManager::~BasicNetworkManager() {
if (task_safety_flag_) { if (task_safety_flag_) {
@ -981,16 +983,8 @@ void BasicNetworkManager::StopNetworkMonitor() {
IPAddress BasicNetworkManager::QueryDefaultLocalAddress(int family) const { IPAddress BasicNetworkManager::QueryDefaultLocalAddress(int family) const {
RTC_DCHECK(family == AF_INET || family == AF_INET6); RTC_DCHECK(family == AF_INET || family == AF_INET6);
// TODO(bugs.webrtc.org/13145): Delete support for null `socket_factory_`,
// require socket factory to be provided to constructor.
SocketFactory* socket_factory = socket_factory_;
if (!socket_factory) {
socket_factory = thread_->socketserver();
}
RTC_DCHECK(socket_factory);
std::unique_ptr<Socket> socket( std::unique_ptr<Socket> socket(
socket_factory->CreateSocket(family, SOCK_DGRAM)); socket_factory_->CreateSocket(family, SOCK_DGRAM));
if (!socket) { if (!socket) {
RTC_LOG_ERR(LS_ERROR) << "Socket creation failed"; RTC_LOG_ERR(LS_ERROR) << "Socket creation failed";
return IPAddress(); return IPAddress();

View file

@ -262,16 +262,6 @@ class RTC_EXPORT BasicNetworkManager : public NetworkManagerBase,
public NetworkBinderInterface, public NetworkBinderInterface,
public sigslot::has_slots<> { public sigslot::has_slots<> {
public: public:
// This version is used by chromium.
ABSL_DEPRECATED(
"Use the version with socket_factory, see bugs.webrtc.org/13145")
explicit BasicNetworkManager(
const webrtc::FieldTrialsView* field_trials = nullptr)
: BasicNetworkManager(
/* network_monitor_factory= */ nullptr,
/* socket_factory= */ nullptr,
field_trials) {}
// This is used by lots of downstream code. // This is used by lots of downstream code.
BasicNetworkManager(SocketFactory* socket_factory, BasicNetworkManager(SocketFactory* socket_factory,
const webrtc::FieldTrialsView* field_trials = nullptr) const webrtc::FieldTrialsView* field_trials = nullptr)