Commit cf4ecdad authored by Qingsi Wang's avatar Qingsi Wang Committed by Commit Bot

Initialize before using PortAllocator and its subclasses.

WebRTC is redesigning the thread model in PortAllocator and its
subclasses. The new threading assumption is that every method of
PortAllocator (including the destructor) must be called on the same
thread after Initialize is called. This allows a PortAllocator subclass
to be constructed and configured on one thread, and passed into an
object that uses it on a different thread.

The above new assumption should be reflected in Chromium objects that
directly use the WebRTC implementation of PortAllocator.

Bug: 832310
Change-Id: I3610a714320f6e230e4e3e15c1101bcafbcc175c
Reviewed-on: https://chromium-review.googlesource.com/1011257Reviewed-by: default avatarYuwei Huang <yuweih@chromium.org>
Commit-Queue: Qingsi Wang <qingsi@google.com>
Cr-Commit-Position: refs/heads/master@{#550774}
parent c1beb481
...@@ -74,6 +74,7 @@ PortAllocator::PortAllocator( ...@@ -74,6 +74,7 @@ PortAllocator::PortAllocator(
set_flags(flags); set_flags(flags);
SetPortRange(network_settings.port_range.min_port, SetPortRange(network_settings.port_range.min_port,
network_settings.port_range.max_port); network_settings.port_range.max_port);
Initialize();
} }
PortAllocator::~PortAllocator() = default; PortAllocator::~PortAllocator() = default;
......
...@@ -54,6 +54,7 @@ FakePortAllocator::FakePortAllocator( ...@@ -54,6 +54,7 @@ FakePortAllocator::FakePortAllocator(
cricket::PORTALLOCATOR_ENABLE_IPV6 | cricket::PORTALLOCATOR_ENABLE_IPV6 |
cricket::PORTALLOCATOR_DISABLE_STUN | cricket::PORTALLOCATOR_DISABLE_STUN |
cricket::PORTALLOCATOR_DISABLE_RELAY); cricket::PORTALLOCATOR_DISABLE_RELAY);
Initialize();
} }
FakePortAllocator::~FakePortAllocator() = default; FakePortAllocator::~FakePortAllocator() = default;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment