| Index: webrtc/base/network.h
|
| diff --git a/webrtc/base/network.h b/webrtc/base/network.h
|
| index 8980b5d57d8ecb4fda77c064335a7d3ab881383a..ce464a6d482ca8afc6215e6f6925b24038cb5c52 100644
|
| --- a/webrtc/base/network.h
|
| +++ b/webrtc/base/network.h
|
| @@ -21,6 +21,7 @@
|
| #include "webrtc/base/messagehandler.h"
|
| #include "webrtc/base/scoped_ptr.h"
|
| #include "webrtc/base/sigslot.h"
|
| +#include "webrtc/base/networkmonitor.h"
|
|
|
| #if defined(WEBRTC_POSIX)
|
| struct ifaddrs;
|
| @@ -32,6 +33,7 @@ extern const char kPublicIPv4Host[];
|
| extern const char kPublicIPv6Host[];
|
|
|
| class Network;
|
| +class NetworkInformation;
|
| class NetworkMonitorInterface;
|
| class Thread;
|
|
|
| @@ -146,6 +148,7 @@ class NetworkManagerBase : public NetworkManager {
|
|
|
| protected:
|
| typedef std::map<std::string, Network*> NetworkMap;
|
| + NetworkMap& networks_map() { return networks_map_; }
|
| // Updates |networks_| with the networks listed in |list|. If
|
| // |network_map_| already has a Network object for a network listed
|
| // in the |list| then it is reused. Accept ownership of the Network
|
| @@ -247,6 +250,9 @@ class BasicNetworkManager : public NetworkManagerBase,
|
| // internally, it returns the default local address on a multi-homed endpoint.
|
| IPAddress QueryDefaultLocalAddress(int family) const;
|
|
|
| +
|
| + void OnNetworkAvailable(const NetworkInformation& network_info);
|
| +
|
| private:
|
| friend class NetworkTest;
|
|
|
| @@ -262,6 +268,11 @@ class BasicNetworkManager : public NetworkManagerBase,
|
| // Only updates the networks; does not reschedule the next update.
|
| void UpdateNetworksOnce();
|
|
|
| + void GetAndUpdateNetworkInfos();
|
| + // this changed network info ???
|
| + void UpdateNetworkInfo(Network* network) const;
|
| +
|
| +
|
| Thread* thread_;
|
| bool sent_first_update_;
|
| int start_count_;
|
| @@ -269,6 +280,7 @@ class BasicNetworkManager : public NetworkManagerBase,
|
| int network_ignore_mask_;
|
| bool ignore_non_default_routes_;
|
| scoped_ptr<NetworkMonitorInterface> network_monitor_;
|
| + std::map<std::string, NetworkInformation> network_infos_;
|
| };
|
|
|
| // Represents a Unix-type network interface, with a name and single address.
|
| @@ -355,7 +367,12 @@ class Network {
|
| bool ignored() const { return ignored_; }
|
| void set_ignored(bool ignored) { ignored_ = ignored; }
|
|
|
| + uint32_t handle() const { return handle_; }
|
| + void set_handle(uint32_t handle) { handle_ = handle; }
|
| +
|
| AdapterType type() const { return type_; }
|
| + void set_type(AdapterType type) { type_ = type; }
|
| +
|
| int preference() const { return preference_; }
|
| void set_preference(int preference) { preference_ = preference; }
|
|
|
| @@ -374,6 +391,7 @@ class Network {
|
| bool ignored_;
|
| AdapterType type_;
|
| int preference_;
|
| + uint32_t handle_ = 0;
|
|
|
| friend class NetworkManager;
|
| };
|
|
|