Commit dfe58844 authored by Paul Jensen's avatar Paul Jensen Committed by Commit Bot

Fix to only call DnsConfigService::WatchConfig() once

This was an accidental bug introduced in r659155 that only happens in the
weird cases where NetworkChangeNotifierWin fails to watch for address
changes.

Bug: 967297
Change-Id: Ic4a575599be4ae4e150f19f672cf07aa82376e83
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1632449
Auto-Submit: Paul Jensen <pauljensen@chromium.org>
Commit-Queue: Eric Orth <ericorth@chromium.org>
Reviewed-by: default avatarEric Orth <ericorth@chromium.org>
Cr-Commit-Position: refs/heads/master@{#663960}
parent d75e6a87
......@@ -294,11 +294,14 @@ void NetworkChangeNotifierWin::WatchForAddressChange() {
bool NetworkChangeNotifierWin::WatchForAddressChangeInternal() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
dns_config_service_runner_->PostTask(
FROM_HERE, base::BindOnce(&DnsConfigService::WatchConfig,
base::Unretained(dns_config_service_.get()),
base::BindRepeating(
&NetworkChangeNotifier::SetDnsConfig)));
if (!posted_watch_config_) {
posted_watch_config_ = true;
dns_config_service_runner_->PostTask(
FROM_HERE, base::BindOnce(&DnsConfigService::WatchConfig,
base::Unretained(dns_config_service_.get()),
base::BindRepeating(
&NetworkChangeNotifier::SetDnsConfig)));
}
ResetEventIfSignaled(addr_overlapped_.hEvent);
HANDLE handle = nullptr;
......
......@@ -124,6 +124,9 @@ class NET_EXPORT_PRIVATE NetworkChangeNotifierWin
// Number of times polled to check if still offline.
int offline_polls_;
// Keeps track of whether DnsConfigService::WatchConfig() has been called.
bool posted_watch_config_ = false;
SEQUENCE_CHECKER(sequence_checker_);
// Used for calling WatchForAddressChange again on failure.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment