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

Unified Diff: net/dns/dns_config_service_win.cc

Issue 10796019: [net/dns] Retry reading config in DnsConfigServiceWin (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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 | « no previous file | no next file » | 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 a8d4ddb80ad18dd89470629c2239356c8ecdcafa..54ef1c0d397fe2316df94e987235c34b89116698 100644
--- a/net/dns/dns_config_service_win.cc
+++ b/net/dns/dns_config_service_win.cc
@@ -38,6 +38,9 @@ namespace internal {
namespace {
+// Interval between retries to parse config. Used only until parsing succeeds.
+const int kRetryIntervalSeconds = 5;
+
const wchar_t* const kPrimaryDnsSuffixPath =
L"SOFTWARE\\Policies\\Microsoft\\System\\DNSClient";
@@ -479,11 +482,16 @@ class DnsConfigServiceWin::ConfigReader : public SerialWorker {
service_->OnConfigRead(dns_config_);
} else {
LOG(WARNING) << "Failed to read DnsConfig.";
+ // Try again in a while in case DnsConfigWatcher missed the signal.
+ MessageLoop::current()->PostDelayedTask(
+ FROM_HERE,
+ base::Bind(&ConfigReader::WorkNow, this),
+ base::TimeDelta::FromSeconds(kRetryIntervalSeconds));
}
}
DnsConfigServiceWin* service_;
- // Written in DoRead(), read in OnReadFinished(). No locking required.
+ // Written in DoWork(), read in OnWorkFinished(). No locking required.
DnsConfig dns_config_;
bool success_;
};
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698