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}
diff --git a/p2p/base/p2p_transport_channel.cc b/p2p/base/p2p_transport_channel.cc
index 1434f9a..2aa1ccb 100644
--- a/p2p/base/p2p_transport_channel.cc
+++ b/p2p/base/p2p_transport_channel.cc
@@ -142,6 +142,7 @@
               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.