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

Unified Diff: net/base/network_change_notifier_mac.h

Issue 9540011: [net] Add DNS-related signals and NetLog to NetworkChangeNotifier. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 10 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
Index: net/base/network_change_notifier_mac.h
diff --git a/net/base/network_change_notifier_mac.h b/net/base/network_change_notifier_mac.h
index ec2bb1fed50e97c42be5bf424f01e8e9117f9546..1db267c5b30ccb83a7494efb8fdaa3a90acf1e03 100644
--- a/net/base/network_change_notifier_mac.h
+++ b/net/base/network_change_notifier_mac.h
@@ -14,6 +14,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/synchronization/condition_variable.h"
#include "base/synchronization/lock.h"
+#include "net/base/file_path_watcher_callback.h"
#include "net/base/network_change_notifier.h"
#include "net/base/network_config_watcher_mac.h"
@@ -24,9 +25,11 @@ class NetworkChangeNotifierMac: public NetworkChangeNotifier {
NetworkChangeNotifierMac();
virtual ~NetworkChangeNotifierMac();
- // NetworkChangeNotifier implementation:
+ // NetworkChangeNotifier:
virtual bool IsCurrentlyOffline() const OVERRIDE;
+ virtual bool IsCurrentlyWatchingDNS() const OVERRIDE;
+
private:
enum OnlineState {
UNINITIALIZED = -1,
@@ -66,6 +69,9 @@ class NetworkChangeNotifierMac: public NetworkChangeNotifier {
void SetDynamicStoreNotificationKeys(SCDynamicStoreRef store);
void OnNetworkConfigChange(CFArrayRef changed_keys);
+ // Called from FilePathWatcherCallback.
+ void OnDNSFileChanged(unsigned detail, bool watch_success);
+
void SetInitialState();
static void ReachabilityCallback(SCNetworkReachabilityRef target,
@@ -83,6 +89,13 @@ class NetworkChangeNotifierMac: public NetworkChangeNotifier {
Forwarder forwarder_;
scoped_ptr<const NetworkConfigWatcherMac> config_watcher_;
+ // DNS watchers and state.
+ FilePathWatcherCallback resolv_watcher_;
+ FilePathWatcherCallback hosts_watcher_;
+
+ bool watching_dns_;
+ mutable base::Lock watching_dns_lock_;
+
DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierMac);
};

Powered by Google App Engine
This is Rietveld 408576698