Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(812)

Side by Side Diff: net/dns/dns_config_service_win.h

Issue 10873018: [net] Move DnsConfigService to NetworkChangeNotifier. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add comment Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/dns/dns_config_service_unittest.cc ('k') | net/dns/dns_config_service_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 CONFIG_PARSE_WIN_NO_NAMESERVERS, 115 CONFIG_PARSE_WIN_NO_NAMESERVERS,
116 CONFIG_PARSE_WIN_MAX // Bounding values for enumeration. 116 CONFIG_PARSE_WIN_MAX // Bounding values for enumeration.
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 125 class NET_EXPORT_PRIVATE DnsConfigServiceWin : public DnsConfigService {
126 : public DnsConfigService,
127 public NetworkChangeNotifier::IPAddressObserver {
128 public: 126 public:
129 DnsConfigServiceWin(); 127 DnsConfigServiceWin();
130 virtual ~DnsConfigServiceWin(); 128 virtual ~DnsConfigServiceWin();
131 129
132 virtual void Watch(const CallbackType& callback) OVERRIDE;
133
134 private: 130 private:
131 class Watcher;
135 class ConfigReader; 132 class ConfigReader;
136 class HostsReader; 133 class HostsReader;
137 134
138 // NetworkChangeNotifier::DNSObserver: 135 // DnsConfigService:
139 virtual void OnDNSChanged(unsigned detail) OVERRIDE; 136 virtual void ReadNow() OVERRIDE;
137 virtual bool StartWatching() OVERRIDE;
140 138
141 // NetworkChangeNotifier::IPAddressObserver: 139 void OnConfigChanged(bool succeeded);
142 virtual void OnIPAddressChanged() OVERRIDE; 140 void OnHostsChanged(bool succeeded);
143 141
142 scoped_ptr<Watcher> watcher_;
144 scoped_refptr<ConfigReader> config_reader_; 143 scoped_refptr<ConfigReader> config_reader_;
145 scoped_refptr<HostsReader> hosts_reader_; 144 scoped_refptr<HostsReader> hosts_reader_;
146 145
147 DISALLOW_COPY_AND_ASSIGN(DnsConfigServiceWin); 146 DISALLOW_COPY_AND_ASSIGN(DnsConfigServiceWin);
148 }; 147 };
149 148
150 } // namespace internal 149 } // namespace internal
151 150
152 } // namespace net 151 } // namespace net
153 152
154 #endif // NET_DNS_DNS_CONFIG_SERVICE_WIN_H_ 153 #endif // NET_DNS_DNS_CONFIG_SERVICE_WIN_H_
155 154
OLDNEW
« no previous file with comments | « net/dns/dns_config_service_unittest.cc ('k') | net/dns/dns_config_service_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698