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: ba9ab4cd8d

Committed: 47872ec90c

Review URL: https://codereview.webrtc.org/1284113003 .

Cr-Commit-Position: refs/heads/master@{#9736}
This commit is contained in:
Guo-wei Shieh
2015-08-19 10:57:53 -07:00
parent 47872ec90c
commit 86cb923c20
2 changed files with 6 additions and 3 deletions

View File

@ -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),

View File

@ -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