summaryrefslogtreecommitdiffstats
path: root/net/dns/dns_config_service_posix.h
diff options
context:
space:
mode:
Diffstat (limited to 'net/dns/dns_config_service_posix.h')
-rw-r--r--net/dns/dns_config_service_posix.h24
1 files changed, 17 insertions, 7 deletions
diff --git a/net/dns/dns_config_service_posix.h b/net/dns/dns_config_service_posix.h
index fa9599e..e266d06 100644
--- a/net/dns/dns_config_service_posix.h
+++ b/net/dns/dns_config_service_posix.h
@@ -17,28 +17,38 @@
namespace net {
-class WatchingFileReader;
+class FilePathWatcherWrapper;
+
+// Use DnsConfigService::CreateSystemService to use it outside of tests.
+namespace internal {
class NET_EXPORT_PRIVATE DnsConfigServicePosix
- : NON_EXPORTED_BASE(public DnsConfigService) {
+ : NON_EXPORTED_BASE(public DnsConfigService) {
public:
DnsConfigServicePosix();
virtual ~DnsConfigServicePosix();
- virtual void Watch() OVERRIDE;
+ virtual void Watch(const CallbackType& callback) OVERRIDE;
private:
- class ConfigReader;
- scoped_ptr<WatchingFileReader> config_watcher_;
- scoped_ptr<WatchingFileReader> hosts_watcher_;
+ void OnConfigChanged(bool watch_succeeded);
+ void OnHostsChanged(bool watch_succeeded);
+
+ scoped_ptr<FilePathWatcherWrapper> config_watcher_;
+ scoped_ptr<FilePathWatcherWrapper> hosts_watcher_;
+
+ scoped_refptr<SerialWorker> config_reader_;
+ scoped_refptr<SerialWorker> hosts_reader_;
DISALLOW_COPY_AND_ASSIGN(DnsConfigServicePosix);
};
-// Fills in |dns_config| from |res|. Exposed for tests.
+// Fills in |dns_config| from |res|.
bool NET_EXPORT_PRIVATE ConvertResStateToDnsConfig(
const struct __res_state& res, DnsConfig* dns_config);
+} // namespace internal
+
} // namespace net
#endif // NET_DNS_DNS_CONFIG_SERVICE_POSIX_H_