| Index: net/dns/dns_config_service.h
|
| diff --git a/net/dns/dns_config_service.h b/net/dns/dns_config_service.h
|
| index b99babe3d0aabbe455580e519df21db993451c94..f8c023d88d4b51af17f81dc01b71aeafb157f13b 100644
|
| --- a/net/dns/dns_config_service.h
|
| +++ b/net/dns/dns_config_service.h
|
| @@ -18,7 +18,6 @@
|
| // std::vector<IPEndPoint>.
|
| #include "net/base/address_list.h"
|
| #include "net/base/ip_endpoint.h" // win requires size of IPEndPoint
|
| -#include "net/base/network_change_notifier.h"
|
| #include "net/base/net_export.h"
|
| #include "net/dns/dns_hosts.h"
|
|
|
| @@ -80,13 +79,12 @@ struct NET_EXPORT_PRIVATE DnsConfig {
|
|
|
|
|
| // Service for reading system DNS settings, on demand or when signalled by
|
| -// NetworkChangeNotifier.
|
| +// internal watchers and NetworkChangeNotifier.
|
| class NET_EXPORT_PRIVATE DnsConfigService
|
| - : NON_EXPORTED_BASE(public base::NonThreadSafe),
|
| - public NetworkChangeNotifier::DNSObserver {
|
| + : NON_EXPORTED_BASE(public base::NonThreadSafe) {
|
| public:
|
| - // Callback interface for the client, called on the same thread as Read() and
|
| - // Watch().
|
| + // Callback interface for the client, called on the same thread as
|
| + // ReadConfig() and WatchConfig().
|
| typedef base::Callback<void(const DnsConfig& config)> CallbackType;
|
|
|
| // Creates the platform-specific DnsConfigService.
|
| @@ -97,15 +95,20 @@ class NET_EXPORT_PRIVATE DnsConfigService
|
|
|
| // Attempts to read the configuration. Will run |callback| when succeeded.
|
| // Can be called at most once.
|
| - void Read(const CallbackType& callback);
|
| + void ReadConfig(const CallbackType& callback);
|
|
|
| - // Registers for notifications at NetworkChangeNotifier. Will attempt to read
|
| - // config after watch is started by NetworkChangeNotifier. Will run |callback|
|
| - // iff config changes from last call or should be withdrawn.
|
| - // Can be called at most once.
|
| - virtual void Watch(const CallbackType& callback);
|
| + // Registers systems watchers. Will attempt to read config after watch starts,
|
| + // but only if watchers started successfully. Will run |callback| iff config
|
| + // changes from last call or has to be withdrawn. Can be called at most once.
|
| + // Might require MessageLoopForIO.
|
| + void WatchConfig(const CallbackType& callback);
|
|
|
| protected:
|
| + // Immediately attempts to read the current configuration.
|
| + virtual void ReadNow() = 0;
|
| + // Registers system watchers. Returns true iff succeeds.
|
| + virtual bool StartWatching() = 0;
|
| +
|
| // Called when the current config (except hosts) has changed.
|
| void InvalidateConfig();
|
| // Called when the current hosts have changed.
|
| @@ -116,10 +119,6 @@ class NET_EXPORT_PRIVATE DnsConfigService
|
| // Called with new hosts. Rest of the config is assumed unchanged.
|
| void OnHostsRead(const DnsHosts& hosts);
|
|
|
| - // NetworkChangeNotifier::DNSObserver:
|
| - // Must be defined by implementations.
|
| - virtual void OnDNSChanged(unsigned detail) OVERRIDE = 0;
|
| -
|
| private:
|
| void StartTimer();
|
| // Called when the timer expires.
|
|
|