Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(689)

Unified Diff: net/base/address_tracker_linux.h

Issue 739983005: Determine connection type in NetworkChangeNotifierLinux. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/base/address_tracker_linux.cc » ('j') | net/base/address_tracker_linux.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/address_tracker_linux.h
diff --git a/net/base/address_tracker_linux.h b/net/base/address_tracker_linux.h
index a960287d4ad2abd2270ace41cd6596b13b6b5a94..4796eaf2a2b42cdf3a280a47f2f5e3c1f1a17b6d 100644
--- a/net/base/address_tracker_linux.h
+++ b/net/base/address_tracker_linux.h
@@ -65,6 +65,13 @@ class NET_EXPORT_PRIVATE AddressTrackerLinux :
// Safe to call from any thread, but will block until Init() has completed.
NetworkChangeNotifier::ConnectionType GetCurrentConnectionType();
+ // Adds/removes a netif name to ignore. Returns true if success.
+ bool AddNetifToIgnore(const std::string& netif_name);
+ bool RemoveNetifToIgnore(const std::string& netif_name);
+
+ bool GetNetworkList(NetworkInterfaceList* networks, int policy) const;
pauljensen 2014/11/21 18:55:36 This API is exposed in net_util.h and should not b
derekjchow1 2014/11/21 23:13:58 Done.
+ std::string GetPrimaryNetif() const;
pauljensen 2014/11/21 18:55:36 This cannot be accurate as there may be multiple i
derekjchow1 2014/11/21 23:13:58 What should the correct behavior of NetworkChangeN
pauljensen 2014/11/24 12:33:18 The correct behavior of NetworkChangeNotifier::Get
+
private:
friend class AddressTrackerLinuxTest;
@@ -84,8 +91,8 @@ class NET_EXPORT_PRIVATE AddressTrackerLinux :
// A function that returns the name of an interface given the interface index
// in |interface_index|.
- typedef const char* (*GetInterfaceNameFunction)(int interface_index);
-
+ typedef char* (*GetInterfaceNameFunction)(unsigned int interface_index,
+ char* ifname);
// Sets |*address_changed| to indicate whether |address_map_| changed and
// sets |*link_changed| to indicate if |online_links_| changed and sets
// |*tunnel_changed| to indicate if |online_links_| changed with regards to a
@@ -132,6 +139,8 @@ class NET_EXPORT_PRIVATE AddressTrackerLinux :
mutable base::Lock address_map_lock_;
AddressMap address_map_;
+ base::hash_set<std::string> netifs_to_ignore_;
+
// Set of interface indices for links that are currently online.
mutable base::Lock online_links_lock_;
base::hash_set<int> online_links_;
« no previous file with comments | « no previous file | net/base/address_tracker_linux.cc » ('j') | net/base/address_tracker_linux.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698