Index: webrtc/base/network.h |
diff --git a/webrtc/base/network.h b/webrtc/base/network.h |
index 8e5c8f0fb70e196acb1bab84321f1aa63812bf96..1eb7e621fe3c28af4fccfcb0f6f7e0bdc8b2f0dd 100644 |
--- a/webrtc/base/network.h |
+++ b/webrtc/base/network.h |
@@ -56,6 +56,15 @@ class NetworkManager { |
public: |
typedef std::vector<Network*> NetworkList; |
+ // This enum indicates the state of GetNetworks. |
+ enum NetworkPermissionState { |
+ STATE_UNKNOWN, // SignalNetworksChanged is not fired yet. |
+ STATE_ALLOWED, // Adapter enumeration is allowed. Getting 0 network from |
+ // GetNetworks means that there is no network available. |
+ STATE_BLOCKED // Adapter enumeration is disabled. GetAnyAddressNetworks() |
+ // should be used instead. |
+ }; |
+ |
NetworkManager(); |
virtual ~NetworkManager(); |
@@ -73,12 +82,17 @@ class NetworkManager { |
virtual void StopUpdating() = 0; |
// Returns the current list of networks available on this machine. |
- // UpdateNetworks() must be called before this method is called. |
+ // StartUpdating() must be called before this method is called. |
// It makes sure that repeated calls return the same object for a |
// given network, so that quality is tracked appropriately. Does not |
// include ignored networks. |
virtual void GetNetworks(NetworkList* networks) const = 0; |
+ // return the current permission state of GetNetworks() |
+ NetworkPermissionState network_permission_state() const { |
+ return network_permission_state_; |
+ } |
+ |
// "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 |
// useful as binding to such interfaces allow default routing behavior like |
@@ -97,6 +111,9 @@ class NetworkManager { |
ipv6_network_count = 0; |
} |
}; |
+ |
+ protected: |
juberti1
2015/08/14 20:58:39
Can this go down into NetworkManagerBase? This cla
|
+ NetworkPermissionState network_permission_state_ = STATE_UNKNOWN; |
}; |
// Base class for NetworkManager implementations. |