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

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

Issue 9369045: [net] HostResolverImpl + DnsTransaction + DnsConfigService = Asynchronous DNS ready for experiments. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Denitted. Created 8 years, 10 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.h ('k') | net/dns/dns_config_service_posix_unittest.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 #include "net/dns/dns_config_service_posix.h" 5 #include "net/dns/dns_config_service_posix.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 77
78 void DnsConfigServicePosix::Watch() { 78 void DnsConfigServicePosix::Watch() {
79 DCHECK(CalledOnValidThread()); 79 DCHECK(CalledOnValidThread());
80 config_watcher_->StartWatch(FilePath(FILE_PATH_LITERAL(_PATH_RESCONF)), 80 config_watcher_->StartWatch(FilePath(FILE_PATH_LITERAL(_PATH_RESCONF)),
81 new ConfigReader(this)); 81 new ConfigReader(this));
82 FilePath hosts_path(FILE_PATH_LITERAL("/etc/hosts")); 82 FilePath hosts_path(FILE_PATH_LITERAL("/etc/hosts"));
83 hosts_watcher_->StartWatch(hosts_path, new DnsHostsReader(hosts_path, this)); 83 hosts_watcher_->StartWatch(hosts_path, new DnsHostsReader(hosts_path, this));
84 } 84 }
85 85
86 // static 86 // static
87 DnsConfigService* DnsConfigService::CreateSystemService() { 87 scoped_ptr<DnsConfigService> DnsConfigService::CreateSystemService() {
88 return new DnsConfigServicePosix(); 88 return scoped_ptr<DnsConfigService>(new DnsConfigServicePosix());
89 } 89 }
90 90
91 #if !defined(OS_ANDROID) 91 #if !defined(OS_ANDROID)
92 bool ConvertResStateToDnsConfig(const struct __res_state& res, 92 bool ConvertResStateToDnsConfig(const struct __res_state& res,
93 DnsConfig* dns_config) { 93 DnsConfig* dns_config) {
94 CHECK(dns_config != NULL); 94 CHECK(dns_config != NULL);
95 DCHECK(res.options & RES_INIT); 95 DCHECK(res.options & RES_INIT);
96 96
97 dns_config->nameservers.clear(); 97 dns_config->nameservers.clear();
98 98
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 #if defined(RES_ROTATE) 138 #if defined(RES_ROTATE)
139 dns_config->rotate = res.options & RES_ROTATE; 139 dns_config->rotate = res.options & RES_ROTATE;
140 #endif 140 #endif
141 dns_config->edns0 = res.options & RES_USE_EDNS0; 141 dns_config->edns0 = res.options & RES_USE_EDNS0;
142 142
143 return true; 143 return true;
144 } 144 }
145 #endif // !defined(OS_ANDROID) 145 #endif // !defined(OS_ANDROID)
146 146
147 } // namespace net 147 } // namespace net
OLDNEW
« no previous file with comments | « net/dns/dns_config_service.h ('k') | net/dns/dns_config_service_posix_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698