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

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

Issue 9969190: [net/dns] Watch configd notifications to detect DnsConfig changes on Mac. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: After review. Created 8 years, 8 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
« no previous file with comments | « no previous file | net/dns/dns_config_service_posix.cc » ('j') | net/dns/dns_config_service_posix.cc » ('J')
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_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
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_
OLDNEW
« no previous file with comments | « no previous file | net/dns/dns_config_service_posix.cc » ('j') | net/dns/dns_config_service_posix.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698