summaryrefslogtreecommitdiffstats
path: root/net/dns
diff options
context:
space:
mode:
authorszym@chromium.org <szym@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-25 18:25:02 +0000
committerszym@chromium.org <szym@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-25 18:25:02 +0000
commit5d66ded98bd0482047e4e8b6531472a692d44d6e (patch)
tree0643d493d783100ec8f815186f4d2328d71b8842 /net/dns
parentbb19a5f30b90156b68278e6d58e3b62ecc297707 (diff)
downloadchromium_src-5d66ded98bd0482047e4e8b6531472a692d44d6e.zip
chromium_src-5d66ded98bd0482047e4e8b6531472a692d44d6e.tar.gz
chromium_src-5d66ded98bd0482047e4e8b6531472a692d44d6e.tar.bz2
[net/dns] Retry reading config in DnsConfigServiceWin
BUG=137914 TEST=AsyncDNS.HaveDnsConfig should reach 99%. Review URL: https://chromiumcodereview.appspot.com/10796019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148371 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/dns')
-rw-r--r--net/dns/dns_config_service_win.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/net/dns/dns_config_service_win.cc b/net/dns/dns_config_service_win.cc
index a8d4ddb..54ef1c0 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_;
};