Don't abort HostResolverImpl::Jobs on initial DNS config read

When Chrome first starts, there's no valid DNS config, and DNS requests
will use the system resolver even if async DNS is enabled. There's no
danger of requests continuing to use an old DnsSession because there
can't have been one before.

Bug: 774596
Change-Id: If51b32ad292ccf5cb9b90cfc4017f53a7d21573f
Reviewed-on: https://chromium-review.googlesource.com/723596
Reviewed-by: Julia Tuttle <[email protected]>
Commit-Queue: Miriam Gershenson <[email protected]>
Cr-Commit-Position: refs/heads/master@{#509835}
diff --git a/net/dns/host_resolver_impl.cc b/net/dns/host_resolver_impl.cc
index 88d9cf7..1ecc71b 100644
--- a/net/dns/host_resolver_impl.cc
+++ b/net/dns/host_resolver_impl.cc
@@ -2489,13 +2489,12 @@
   // We want a new DnsSession in place, before we Abort running Jobs, so that
   // the newly started jobs use the new config.
   if (dns_client_.get()) {
+    // Make sure that if the update is an initial read, not a change, there
+    // wasn't already a DnsConfig.
+    DCHECK(config_changed || !dns_client_->GetConfig());
     dns_client_->SetConfig(dns_config);
-    if (dns_client_->GetConfig()) {
+    if (dns_client_->GetConfig())
       UMA_HISTOGRAM_BOOLEAN("AsyncDNS.DnsClientEnabled", true);
-      // If we just switched DnsClients, restart jobs using new resolver.
-      // TODO(pauljensen): Is this necessary?
-      config_changed = true;
-    }
   }
 
   if (config_changed) {