Chromium Code Reviews| Index: webrtc/base/network.h |
| diff --git a/webrtc/base/network.h b/webrtc/base/network.h |
| index 8980b5d57d8ecb4fda77c064335a7d3ab881383a..d2e013e0cf1efdfc05d0fc4af7d5455dc462092a 100644 |
| --- a/webrtc/base/network.h |
| +++ b/webrtc/base/network.h |
| @@ -111,11 +111,10 @@ class NetworkManager : public DefaultLocalAddressProvider { |
| // TODO(guoweis): remove this body when chromium implements this. |
| virtual void GetAnyAddressNetworks(NetworkList* networks) {} |
| + // Dumps the current list of networks in the network manager. |
| + virtual void DumpNetworks() {} |
| bool GetDefaultLocalAddress(int family, IPAddress* ipaddr) const override; |
| - // Dumps a list of networks available to LS_INFO. |
| - virtual void DumpNetworks(bool include_ignored) {} |
| - |
| struct Stats { |
| int ipv4_network_count; |
| int ipv6_network_count; |
| @@ -195,8 +194,7 @@ class BasicNetworkManager : public NetworkManagerBase, |
| void StartUpdating() override; |
| void StopUpdating() override; |
| - // Logs the available networks. |
| - void DumpNetworks(bool include_ignored) override; |
| + void DumpNetworks() override; |
| // MessageHandler interface. |
| void OnMessage(Message* msg) override; |
| @@ -359,6 +357,12 @@ class Network { |
| int preference() const { return preference_; } |
| void set_preference(int preference) { preference_ = preference; } |
| + // When we enumerate networks and find a previously-seen network is missing, |
| + // we do not remove it (because it may be used elsewhere). Instead, we mark |
| + // it inactive, so that we can detect network changes properly. |
| + bool active() const { return active_; } |
| + void set_active(bool active) { active_ = active; } |
|
pthatcher1
2015/12/18 22:03:39
Does set_active need to be public? Since NetworkM
honghaiz3
2015/12/21 04:30:04
It was used by NetworkManagerBase. So we cannot ma
|
| + |
| // Debugging description of this network |
| std::string ToString() const; |
| @@ -374,6 +378,7 @@ class Network { |
| bool ignored_; |
| AdapterType type_; |
| int preference_; |
| + bool active_ = true; |
| friend class NetworkManager; |
| }; |