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

Unified Diff: net/base/address_tracker_linux.h

Issue 571743002: Adding non-tracking mode support to AddressTracker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add track option in AddressTrackerLinux::Init Created 6 years, 3 months 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 415e8c89e9d8dc354d48c8a48dc24064068f71fd..b092bf2148188a68c22cbeaf31fcd3db4c15a360 100644
--- a/net/base/address_tracker_linux.h
+++ b/net/base/address_tracker_linux.h
@@ -41,11 +41,14 @@ class NET_EXPORT_PRIVATE AddressTrackerLinux :
const base::Closure& tunnel_callback);
virtual ~AddressTrackerLinux();
- // Starts watching system configuration for changes. The current thread must
- // have a MessageLoopForIO.
- void Init();
+ // When |track| is true, it starts watching system configuration for
+ // changes. The current thread must have a
+ // MessageLoopForIO. Otherwise, the |AddressMap| and |online_links_|
+ // will be a one time snapshot of current system configuration.
+ void Init(bool track);
AddressMap GetAddressMap() const;
+ base::hash_set<int> GetOnlineLinks() const;
// Implementation of NetworkChangeNotifierLinux::GetCurrentConnectionType().
// Safe to call from any thread, but will block until Init() has completed.
@@ -105,6 +108,7 @@ class NET_EXPORT_PRIVATE AddressTrackerLinux :
AddressMap address_map_;
// Set of interface indices for links that are currently online.
+ mutable base::Lock online_links_lock_;
base::hash_set<int> online_links_;
base::Lock is_offline_lock_;
« 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