Add a flag to filter out high-cost networks.
This allows webrtc to not gather on cellular networks if wifi or
other low cost networks are present.
BUG=

Review-Url: https://codereview.webrtc.org/1987833002
Cr-Commit-Position: refs/heads/master@{#12979}
diff --git a/webrtc/api/peerconnection.cc b/webrtc/api/peerconnection.cc
index 5a0d32a..d5cbd5e 100644
--- a/webrtc/api/peerconnection.cc
+++ b/webrtc/api/peerconnection.cc
@@ -2128,6 +2128,12 @@
     LOG(LS_INFO) << "TCP candidates are disabled.";
   }
 
+  if (configuration.candidate_network_policy ==
+      kCandidateNetworkPolicyLowCost) {
+    portallocator_flags |= cricket::PORTALLOCATOR_DISABLE_COSTLY_NETWORKS;
+    LOG(LS_INFO) << "Do not gather candidates on high-cost networks";
+  }
+
   port_allocator_->set_flags(portallocator_flags);
   // No step delay is used while allocating ports.
   port_allocator_->set_step_delay(cricket::kMinimumStepDelay);