| 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_WIN_H_ | 5 #ifndef NET_DNS_DNS_CONFIG_SERVICE_WIN_H_ |
| 6 #define NET_DNS_DNS_CONFIG_SERVICE_WIN_H_ | 6 #define NET_DNS_DNS_CONFIG_SERVICE_WIN_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 // The sole purpose of dns_config_service_win.h is for unittests so we just | 9 // The sole purpose of dns_config_service_win.h is for unittests so we just |
| 10 // include these headers here. | 10 // include these headers here. |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 class NET_EXPORT_PRIVATE DnsConfigServiceWin | 41 class NET_EXPORT_PRIVATE DnsConfigServiceWin |
| 42 : NON_EXPORTED_BASE(public DnsConfigService) { | 42 : NON_EXPORTED_BASE(public DnsConfigService) { |
| 43 public: | 43 public: |
| 44 DnsConfigServiceWin(); | 44 DnsConfigServiceWin(); |
| 45 virtual ~DnsConfigServiceWin(); | 45 virtual ~DnsConfigServiceWin(); |
| 46 | 46 |
| 47 virtual void Watch(const CallbackType& callback) OVERRIDE; | 47 virtual void Watch(const CallbackType& callback) OVERRIDE; |
| 48 | 48 |
| 49 private: | 49 private: |
| 50 class ConfigReader; | 50 class ConfigReader; |
| 51 | 51 class HostsReader; |
| 52 void OnHostsChanged(bool succeeded); | |
| 53 | 52 |
| 54 scoped_refptr<ConfigReader> config_reader_; | 53 scoped_refptr<ConfigReader> config_reader_; |
| 55 scoped_ptr<FilePathWatcherWrapper> hosts_watcher_; | 54 scoped_ptr<HostsReader> hosts_reader_; |
| 56 scoped_refptr<SerialWorker> hosts_reader_; | |
| 57 | 55 |
| 58 DISALLOW_COPY_AND_ASSIGN(DnsConfigServiceWin); | 56 DISALLOW_COPY_AND_ASSIGN(DnsConfigServiceWin); |
| 59 }; | 57 }; |
| 60 | 58 |
| 61 // All relevant settings read from registry and IP Helper. This isolates our | 59 // All relevant settings read from registry and IP Helper. This isolates our |
| 62 // logic from system calls and is exposed for unit tests. Keep it an aggregate | 60 // logic from system calls and is exposed for unit tests. Keep it an aggregate |
| 63 // struct for easy initialization. | 61 // struct for easy initialization. |
| 64 struct NET_EXPORT_PRIVATE DnsSystemSettings { | 62 struct NET_EXPORT_PRIVATE DnsSystemSettings { |
| 65 // The |set| flag distinguishes between empty and unset values. | 63 // The |set| flag distinguishes between empty and unset values. |
| 66 struct RegString { | 64 struct RegString { |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 // Fills in |dns_config| from |settings|. Exposed for tests. | 110 // Fills in |dns_config| from |settings|. Exposed for tests. |
| 113 bool NET_EXPORT_PRIVATE ConvertSettingsToDnsConfig( | 111 bool NET_EXPORT_PRIVATE ConvertSettingsToDnsConfig( |
| 114 const DnsSystemSettings& settings, DnsConfig* dns_config); | 112 const DnsSystemSettings& settings, DnsConfig* dns_config); |
| 115 | 113 |
| 116 } // namespace internal | 114 } // namespace internal |
| 117 | 115 |
| 118 } // namespace net | 116 } // namespace net |
| 119 | 117 |
| 120 #endif // NET_DNS_DNS_CONFIG_SERVICE_WIN_H_ | 118 #endif // NET_DNS_DNS_CONFIG_SERVICE_WIN_H_ |
| 121 | 119 |
| OLD | NEW |