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

Unified Diff: net/base/network_change_notifier.h

Issue 7737034: Revert 99677 (didn't help) - Revert 99666 (sync tests started failing on mac10.6: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 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 | « net/base/host_resolver_proc.cc ('k') | net/base/network_change_notifier.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/network_change_notifier.h
===================================================================
--- net/base/network_change_notifier.h (revision 99692)
+++ net/base/network_change_notifier.h (working copy)
@@ -50,6 +50,22 @@
DISALLOW_COPY_AND_ASSIGN(OnlineStateObserver);
};
+ class NET_EXPORT DNSObserver {
+ public:
+ virtual ~DNSObserver() {}
+
+ // Will be called when the DNS resolver of the system may have changed.
+ // This is only used on Linux currently and watches /etc/resolv.conf
+ // and /etc/hosts
+ virtual void OnDNSChanged() = 0;
+
+ protected:
+ DNSObserver() {}
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DNSObserver);
+ };
+
virtual ~NetworkChangeNotifier();
// See the description of NetworkChangeNotifier::IsOffline().
@@ -89,6 +105,7 @@
// thread), in which case it will simply do nothing.
static void AddIPAddressObserver(IPAddressObserver* observer);
static void AddOnlineStateObserver(OnlineStateObserver* observer);
+ static void AddDNSObserver(DNSObserver* observer);
// Unregisters |observer| from receiving notifications. This must be called
// on the same thread on which AddObserver() was called. Like AddObserver(),
@@ -99,6 +116,7 @@
// there's no reason to use the API in this risky way, so don't do it.
static void RemoveIPAddressObserver(IPAddressObserver* observer);
static void RemoveOnlineStateObserver(OnlineStateObserver* observer);
+ static void RemoveDNSObserver(DNSObserver* observer);
// Allow unit tests to trigger notifications.
static void NotifyObserversOfIPAddressChangeForTests() {
@@ -113,12 +131,15 @@
// tests.
static void NotifyObserversOfIPAddressChange();
static void NotifyObserversOfOnlineStateChange();
+ static void NotifyObserversOfDNSChange();
private:
const scoped_refptr<ObserverListThreadSafe<IPAddressObserver> >
ip_address_observer_list_;
const scoped_refptr<ObserverListThreadSafe<OnlineStateObserver> >
online_state_observer_list_;
+ const scoped_refptr<ObserverListThreadSafe<DNSObserver> >
+ resolver_state_observer_list_;
DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifier);
};
« no previous file with comments | « net/base/host_resolver_proc.cc ('k') | net/base/network_change_notifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698