| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef NET_DNS_DNS_CONFIG_SERVICE_POSIX_H_ | 5 #ifndef NET_DNS_DNS_CONFIG_SERVICE_POSIX_H_ |
| 6 #define NET_DNS_DNS_CONFIG_SERVICE_POSIX_H_ | 6 #define NET_DNS_DNS_CONFIG_SERVICE_POSIX_H_ |
| 7 | 7 |
| 8 #if !defined(OS_ANDROID) | 8 #if !defined(OS_ANDROID) |
| 9 #include <sys/types.h> | 9 #include <sys/types.h> |
| 10 #include <netinet/in.h> | 10 #include <netinet/in.h> |
| 11 #include <resolv.h> | 11 #include <resolv.h> |
| 12 #endif | 12 #endif |
| 13 | 13 |
| 14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
| 15 #include "net/base/net_export.h" | 15 #include "net/base/net_export.h" |
| 16 #include "net/dns/dns_config_service.h" | 16 #include "net/dns/dns_config_service.h" |
| 17 | 17 |
| 18 namespace net { | 18 namespace net { |
| 19 | 19 |
| 20 // Use DnsConfigService::CreateSystemService to use it outside of tests. | 20 // Use DnsConfigService::CreateSystemService to use it outside of tests. |
| 21 namespace internal { | 21 namespace internal { |
| 22 | 22 |
| 23 class NET_EXPORT_PRIVATE DnsConfigServicePosix : public DnsConfigService { | 23 class NET_EXPORT_PRIVATE DnsConfigServicePosix : public DnsConfigService { |
| 24 public: | 24 public: |
| 25 DnsConfigServicePosix(); | 25 DnsConfigServicePosix(); |
| 26 virtual ~DnsConfigServicePosix(); | 26 virtual ~DnsConfigServicePosix(); |
| 27 | 27 |
| 28 protected: | 28 protected: |
| 29 // DnsConfigService: | 29 // DnsConfigService: |
| 30 virtual void ReadNow() OVERRIDE; | 30 virtual void ReadNow() override; |
| 31 virtual bool StartWatching() OVERRIDE; | 31 virtual bool StartWatching() override; |
| 32 | 32 |
| 33 private: | 33 private: |
| 34 class Watcher; | 34 class Watcher; |
| 35 class ConfigReader; | 35 class ConfigReader; |
| 36 class HostsReader; | 36 class HostsReader; |
| 37 | 37 |
| 38 void OnConfigChanged(bool succeeded); | 38 void OnConfigChanged(bool succeeded); |
| 39 void OnHostsChanged(bool succeeded); | 39 void OnHostsChanged(bool succeeded); |
| 40 | 40 |
| 41 scoped_ptr<Watcher> watcher_; | 41 scoped_ptr<Watcher> watcher_; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 63 // Fills in |dns_config| from |res|. | 63 // Fills in |dns_config| from |res|. |
| 64 ConfigParsePosixResult NET_EXPORT_PRIVATE ConvertResStateToDnsConfig( | 64 ConfigParsePosixResult NET_EXPORT_PRIVATE ConvertResStateToDnsConfig( |
| 65 const struct __res_state& res, DnsConfig* dns_config); | 65 const struct __res_state& res, DnsConfig* dns_config); |
| 66 #endif | 66 #endif |
| 67 | 67 |
| 68 } // namespace internal | 68 } // namespace internal |
| 69 | 69 |
| 70 } // namespace net | 70 } // namespace net |
| 71 | 71 |
| 72 #endif // NET_DNS_DNS_CONFIG_SERVICE_POSIX_H_ | 72 #endif // NET_DNS_DNS_CONFIG_SERVICE_POSIX_H_ |
| OLD | NEW |