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

Unified Diff: net/dns/dns_config_service_win.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/dns/dns_config_service_posix_unittest.cc ('k') | net/dns/dns_response.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/dns/dns_config_service_win.cc
diff --git a/net/dns/dns_config_service_win.cc b/net/dns/dns_config_service_win.cc
index d4a615f00485dbae5226be36a53de69bfe84e95d..14bb773e047ddad1f95e3005c87f9a5c528ba325 100644
--- a/net/dns/dns_config_service_win.cc
+++ b/net/dns/dns_config_service_win.cc
@@ -307,9 +307,6 @@ class DnsConfigServiceWin::ConfigReader : public SerialWorker {
bool StartWatch() {
DCHECK(loop()->BelongsToCurrentThread());
- // This is done only once per lifetime so open the keys on this thread.
- base::ThreadRestrictions::ScopedAllowIO allow_io;
-
base::Closure callback = base::Bind(&SerialWorker::WorkNow,
base::Unretained(this));
@@ -448,6 +445,12 @@ DnsConfigServiceWin::~DnsConfigServiceWin() {
void DnsConfigServiceWin::Watch() {
DCHECK(CalledOnValidThread());
+
+ // This is done only once per lifetime so open the keys and file watcher
+ // handles on this thread.
+ // TODO(szym): Should/can this be avoided? http://crbug.com/114223
+ base::ThreadRestrictions::ScopedAllowIO allow_io;
+
bool started = config_reader_->StartWatch();
// TODO(szym): handle possible failure
DCHECK(started);
@@ -461,8 +464,8 @@ void DnsConfigServiceWin::Watch() {
}
// static
-DnsConfigService* DnsConfigService::CreateSystemService() {
- return new DnsConfigServiceWin();
+scoped_ptr<DnsConfigService> DnsConfigService::CreateSystemService() {
+ return scoped_ptr<DnsConfigService>(new DnsConfigServiceWin());
}
} // namespace net
« no previous file with comments | « net/dns/dns_config_service_posix_unittest.cc ('k') | net/dns/dns_response.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698