Add DCHECK on the port allocator in P2PTransportChannel.

Methods of P2PTransportChannel have been assuming a non-null port
allocator for a long time, and yet the constructor does not check for
that. With the recent change that wires a signal in the port allocator
to the transport in the constructor, a valid allocator becomes a must.

Bug: None
Change-Id: I4ec2e5b577d74a598ee3c2f8ad59e9f0285ac4b9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/135880
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Commit-Queue: Qingsi Wang <qingsi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27897}
This commit is contained in:
Qingsi Wang
2019-05-09 10:37:26 -07:00
committed by Commit Bot
parent 37f2b43274
commit 0fa8605640

View File

@ -142,6 +142,7 @@ P2PTransportChannel::P2PTransportChannel(
true /* presume_writable_when_fully_relayed */,
REGATHER_ON_FAILED_NETWORKS_INTERVAL,
RECEIVING_SWITCHING_DELAY) {
RTC_DCHECK(allocator_ != nullptr);
weak_ping_interval_ = GetWeakPingIntervalInFieldTrial();
// Validate IceConfig even for mostly built-in constant default values in case
// we change them.