Chromium Code Reviews| 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 | 7 |
| 8 // The sole purpose of dns_config_service_win.h is for unittests so we just | 8 // The sole purpose of dns_config_service_win.h is for unittests so we just |
| 9 // include these headers here. | 9 // include these headers here. |
| 10 #include <winsock2.h> | 10 #include <winsock2.h> |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 117 }; | 117 }; |
| 118 | 118 |
| 119 // Fills in |dns_config| from |settings|. Exposed for tests. | 119 // Fills in |dns_config| from |settings|. Exposed for tests. |
| 120 ConfigParseWinResult NET_EXPORT_PRIVATE ConvertSettingsToDnsConfig( | 120 ConfigParseWinResult NET_EXPORT_PRIVATE ConvertSettingsToDnsConfig( |
| 121 const DnsSystemSettings& settings, | 121 const DnsSystemSettings& settings, |
| 122 DnsConfig* dns_config); | 122 DnsConfig* dns_config); |
| 123 | 123 |
| 124 // Use DnsConfigService::CreateSystemService to use it outside of tests. | 124 // Use DnsConfigService::CreateSystemService to use it outside of tests. |
| 125 class NET_EXPORT_PRIVATE DnsConfigServiceWin : public DnsConfigService { | 125 class NET_EXPORT_PRIVATE DnsConfigServiceWin : public DnsConfigService { |
| 126 public: | 126 public: |
| 127 class Watcher; | |
|
szym
2013/01/20 06:52:08
Why is this necessary? Can't you friend it when it
| |
| 128 | |
| 127 DnsConfigServiceWin(); | 129 DnsConfigServiceWin(); |
| 128 virtual ~DnsConfigServiceWin(); | 130 virtual ~DnsConfigServiceWin(); |
| 129 | 131 |
| 130 private: | 132 private: |
| 131 class Watcher; | |
| 132 class ConfigReader; | 133 class ConfigReader; |
| 133 class HostsReader; | 134 class HostsReader; |
| 134 | 135 |
| 135 // DnsConfigService: | 136 // DnsConfigService: |
| 136 virtual void ReadNow() OVERRIDE; | 137 virtual void ReadNow() OVERRIDE; |
| 137 virtual bool StartWatching() OVERRIDE; | 138 virtual bool StartWatching() OVERRIDE; |
| 138 | 139 |
| 139 void OnConfigChanged(bool succeeded); | 140 void OnConfigChanged(bool succeeded); |
| 140 void OnHostsChanged(bool succeeded); | 141 void OnHostsChanged(bool succeeded); |
| 141 | 142 |
| 142 scoped_ptr<Watcher> watcher_; | 143 scoped_ptr<Watcher> watcher_; |
| 143 scoped_refptr<ConfigReader> config_reader_; | 144 scoped_refptr<ConfigReader> config_reader_; |
| 144 scoped_refptr<HostsReader> hosts_reader_; | 145 scoped_refptr<HostsReader> hosts_reader_; |
| 145 | 146 |
| 146 DISALLOW_COPY_AND_ASSIGN(DnsConfigServiceWin); | 147 DISALLOW_COPY_AND_ASSIGN(DnsConfigServiceWin); |
| 147 }; | 148 }; |
| 148 | 149 |
| 149 } // namespace internal | 150 } // namespace internal |
| 150 | 151 |
| 151 } // namespace net | 152 } // namespace net |
| 152 | 153 |
| 153 #endif // NET_DNS_DNS_CONFIG_SERVICE_WIN_H_ | 154 #endif // NET_DNS_DNS_CONFIG_SERVICE_WIN_H_ |
| 154 | 155 |
| OLD | NEW |