From 86cb923c20e8e50dbb9e3d7984ec1bd5d2455b6a Mon Sep 17 00:00:00 2001 From: Guo-wei Shieh Date: Wed, 19 Aug 2015 10:57:53 -0700 Subject: [PATCH] In the past, P2PPortAllocator.enable_multiple_routes is the indicator whether we should bind to the any address. It's easy to translate that into a port allocator flag in P2PPortAllocator's ctor. Going forward, we have to depend on an asynchronous permission check to determine whether gathering local address is allowed or not, hence the current way of passing it through constructor approach won't work any more. The asynchronous check will trigger SignalNetowrksChanged so we could only check that inside DoAllocate. Adapter enumeration disable should be a concept from Network. Network will be hooked up with media permission (mic/camera) to check whether gathering local address is allowed. BUG=crbug.com/520101 R=juberti@webrtc.org, pthatcher@webrtc.org Committed: https://chromium.googlesource.com/external/webrtc/+/ba9ab4cd8d2e8fbc068dc36b5e6f6331d7deeccf Committed: https://chromium.googlesource.com/external/webrtc/+/47872ec90c99ce9c37fb37a8f623ce0e65a32f61 Review URL: https://codereview.webrtc.org/1284113003 . Cr-Commit-Position: refs/heads/master@{#9736} --- webrtc/base/network.cc | 5 +++++ webrtc/base/network.h | 4 +--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/webrtc/base/network.cc b/webrtc/base/network.cc index 8dda89f42c..ff9c01afdf 100644 --- a/webrtc/base/network.cc +++ b/webrtc/base/network.cc @@ -163,6 +163,11 @@ NetworkManager::NetworkManager() { NetworkManager::~NetworkManager() { } +NetworkManager::EnumerationPermission NetworkManager::enumeration_permission() + const { + return kEnumerationAllowed; +} + NetworkManagerBase::NetworkManagerBase() : enumeration_permission_(NetworkManager::kEnumerationAllowed), max_ipv6_networks_(kMaxIPv6Networks), diff --git a/webrtc/base/network.h b/webrtc/base/network.h index 1391572adf..c4cd565ab4 100644 --- a/webrtc/base/network.h +++ b/webrtc/base/network.h @@ -90,9 +90,7 @@ class NetworkManager { virtual void GetNetworks(NetworkList* networks) const = 0; // return the current permission state of GetNetworks() - virtual EnumerationPermission enumeration_permission() const { - return kEnumerationAllowed; - } + virtual EnumerationPermission enumeration_permission() const; // "AnyAddressNetwork" is a network which only contains single "any address" // IP address. (i.e. INADDR_ANY for IPv4 or in6addr_any for IPv6). This is