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> |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 void OnHostsChanged(bool succeeded); | 64 void OnHostsChanged(bool succeeded); |
65 | 65 |
66 scoped_ptr<Watcher> watcher_; | 66 scoped_ptr<Watcher> watcher_; |
67 // Allow a mock hosts file for testing purposes. | 67 // Allow a mock hosts file for testing purposes. |
68 const base::FilePath::CharType* file_path_hosts_; | 68 const base::FilePath::CharType* file_path_hosts_; |
69 // Allow a mock DNS server for testing purposes. | 69 // Allow a mock DNS server for testing purposes. |
70 const DnsConfig* dns_config_for_testing_; | 70 const DnsConfig* dns_config_for_testing_; |
71 scoped_refptr<ConfigReader> config_reader_; | 71 scoped_refptr<ConfigReader> config_reader_; |
72 scoped_refptr<HostsReader> hosts_reader_; | 72 scoped_refptr<HostsReader> hosts_reader_; |
73 #if defined(OS_ANDROID) | 73 #if defined(OS_ANDROID) |
74 // Has DnsConfigWatcher detected any config chagnes yet? | 74 // Has DnsConfigWatcher detected any config changes yet? |
75 bool seen_config_change_; | 75 bool seen_config_change_; |
76 #endif | 76 #endif |
77 | 77 |
78 DISALLOW_COPY_AND_ASSIGN(DnsConfigServicePosix); | 78 DISALLOW_COPY_AND_ASSIGN(DnsConfigServicePosix); |
79 }; | 79 }; |
80 | 80 |
81 enum ConfigParsePosixResult { | 81 enum ConfigParsePosixResult { |
82 CONFIG_PARSE_POSIX_OK = 0, | 82 CONFIG_PARSE_POSIX_OK = 0, |
83 CONFIG_PARSE_POSIX_RES_INIT_FAILED, | 83 CONFIG_PARSE_POSIX_RES_INIT_FAILED, |
84 CONFIG_PARSE_POSIX_RES_INIT_UNSET, | 84 CONFIG_PARSE_POSIX_RES_INIT_UNSET, |
(...skipping 11 matching lines...) Expand all Loading... |
96 // Fills in |dns_config| from |res|. | 96 // Fills in |dns_config| from |res|. |
97 ConfigParsePosixResult NET_EXPORT_PRIVATE ConvertResStateToDnsConfig( | 97 ConfigParsePosixResult NET_EXPORT_PRIVATE ConvertResStateToDnsConfig( |
98 const struct __res_state& res, DnsConfig* dns_config); | 98 const struct __res_state& res, DnsConfig* dns_config); |
99 #endif | 99 #endif |
100 | 100 |
101 } // namespace internal | 101 } // namespace internal |
102 | 102 |
103 } // namespace net | 103 } // namespace net |
104 | 104 |
105 #endif // NET_DNS_DNS_CONFIG_SERVICE_POSIX_H_ | 105 #endif // NET_DNS_DNS_CONFIG_SERVICE_POSIX_H_ |
OLD | NEW |