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

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: Fix ClientSocketFactory lifetime. Move ScopedAllowIO to StartWatch. Added DnsTask logging. 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
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..3695eab1da79d5e02b592cf11137b35fa5ed439c 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,11 @@ 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.
+ base::ThreadRestrictions::ScopedAllowIO allow_io;
cbentzel 2012/02/14 02:01:54 Can you add a bug about whether we should try to r
+
bool started = config_reader_->StartWatch();
// TODO(szym): handle possible failure
DCHECK(started);
@@ -461,8 +463,8 @@ void DnsConfigServiceWin::Watch() {
}
// static
-DnsConfigService* DnsConfigService::CreateSystemService() {
- return new DnsConfigServiceWin();
+scoped_ptr<DnsConfigService> DnsConfigService::CreateSystemService() {
+ return scoped_ptr<DnsConfigService>(new DnsConfigServiceWin());
}
} // namespace net

Powered by Google App Engine
This is Rietveld 408576698