| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <sys/types.h> | 9 #include <sys/types.h> |
| 10 #include <netinet/in.h> | 10 #include <netinet/in.h> |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 class NET_EXPORT_PRIVATE DnsConfigServicePosix | 25 class NET_EXPORT_PRIVATE DnsConfigServicePosix |
| 26 : NON_EXPORTED_BASE(public DnsConfigService) { | 26 : NON_EXPORTED_BASE(public DnsConfigService) { |
| 27 public: | 27 public: |
| 28 DnsConfigServicePosix(); | 28 DnsConfigServicePosix(); |
| 29 virtual ~DnsConfigServicePosix(); | 29 virtual ~DnsConfigServicePosix(); |
| 30 | 30 |
| 31 virtual void Watch(const CallbackType& callback) OVERRIDE; | 31 virtual void Watch(const CallbackType& callback) OVERRIDE; |
| 32 | 32 |
| 33 private: | 33 private: |
| 34 class ConfigWatcher; |
| 35 |
| 34 void OnConfigChanged(bool watch_succeeded); | 36 void OnConfigChanged(bool watch_succeeded); |
| 35 void OnHostsChanged(bool watch_succeeded); | 37 void OnHostsChanged(bool watch_succeeded); |
| 36 | 38 |
| 37 scoped_ptr<FilePathWatcherWrapper> config_watcher_; | 39 scoped_ptr<ConfigWatcher> config_watcher_; |
| 38 scoped_ptr<FilePathWatcherWrapper> hosts_watcher_; | 40 scoped_ptr<FilePathWatcherWrapper> hosts_watcher_; |
| 39 | 41 |
| 40 scoped_refptr<SerialWorker> config_reader_; | 42 scoped_refptr<SerialWorker> config_reader_; |
| 41 scoped_refptr<SerialWorker> hosts_reader_; | 43 scoped_refptr<SerialWorker> hosts_reader_; |
| 42 | 44 |
| 43 DISALLOW_COPY_AND_ASSIGN(DnsConfigServicePosix); | 45 DISALLOW_COPY_AND_ASSIGN(DnsConfigServicePosix); |
| 44 }; | 46 }; |
| 45 | 47 |
| 46 // Fills in |dns_config| from |res|. | 48 // Fills in |dns_config| from |res|. |
| 47 bool NET_EXPORT_PRIVATE ConvertResStateToDnsConfig( | 49 bool NET_EXPORT_PRIVATE ConvertResStateToDnsConfig( |
| 48 const struct __res_state& res, DnsConfig* dns_config); | 50 const struct __res_state& res, DnsConfig* dns_config); |
| 49 | 51 |
| 50 } // namespace internal | 52 } // namespace internal |
| 51 | 53 |
| 52 } // namespace net | 54 } // namespace net |
| 53 | 55 |
| 54 #endif // NET_DNS_DNS_CONFIG_SERVICE_POSIX_H_ | 56 #endif // NET_DNS_DNS_CONFIG_SERVICE_POSIX_H_ |
| OLD | NEW |