OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/dns/host_resolver_impl.h" | 5 #include "net/dns/host_resolver_impl.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <Winsock2.h> | 8 #include <Winsock2.h> |
9 #elif defined(OS_POSIX) | 9 #elif defined(OS_POSIX) |
10 #include <netdb.h> | 10 #include <netdb.h> |
(...skipping 1437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1448 DNS_HISTOGRAM_BY_PRIORITY("AsyncDNS.JobQueueTime", priority(), | 1448 DNS_HISTOGRAM_BY_PRIORITY("AsyncDNS.JobQueueTime", priority(), |
1449 queue_time); | 1449 queue_time); |
1450 DNS_HISTOGRAM_BY_PRIORITY("AsyncDNS.JobQueueTimeAfterChange", priority(), | 1450 DNS_HISTOGRAM_BY_PRIORITY("AsyncDNS.JobQueueTimeAfterChange", priority(), |
1451 queue_time_after_change); | 1451 queue_time_after_change); |
1452 } else { | 1452 } else { |
1453 DNS_HISTOGRAM_BY_PRIORITY("DNS.JobQueueTime", priority(), queue_time); | 1453 DNS_HISTOGRAM_BY_PRIORITY("DNS.JobQueueTime", priority(), queue_time); |
1454 DNS_HISTOGRAM_BY_PRIORITY("DNS.JobQueueTimeAfterChange", priority(), | 1454 DNS_HISTOGRAM_BY_PRIORITY("DNS.JobQueueTimeAfterChange", priority(), |
1455 queue_time_after_change); | 1455 queue_time_after_change); |
1456 } | 1456 } |
1457 | 1457 |
| 1458 bool system_only = |
| 1459 (key_.host_resolver_flags & HOST_RESOLVER_SYSTEM_ONLY) != 0; |
| 1460 |
1458 // Caution: Job::Start must not complete synchronously. | 1461 // Caution: Job::Start must not complete synchronously. |
1459 if (had_dns_config_ && !ResemblesMulticastDNSName(key_.hostname)) { | 1462 if (!system_only && had_dns_config_ && |
| 1463 !ResemblesMulticastDNSName(key_.hostname)) { |
1460 StartDnsTask(); | 1464 StartDnsTask(); |
1461 } else { | 1465 } else { |
1462 StartProcTask(); | 1466 StartProcTask(); |
1463 } | 1467 } |
1464 } | 1468 } |
1465 | 1469 |
1466 // TODO(szym): Since DnsTransaction does not consume threads, we can increase | 1470 // TODO(szym): Since DnsTransaction does not consume threads, we can increase |
1467 // the limits on |dispatcher_|. But in order to keep the number of WorkerPool | 1471 // the limits on |dispatcher_|. But in order to keep the number of WorkerPool |
1468 // threads low, we will need to use an "inner" PrioritizedDispatcher with | 1472 // threads low, we will need to use an "inner" PrioritizedDispatcher with |
1469 // tighter limits. | 1473 // tighter limits. |
(...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2343 dns_client_->SetConfig(dns_config); | 2347 dns_client_->SetConfig(dns_config); |
2344 num_dns_failures_ = 0; | 2348 num_dns_failures_ = 0; |
2345 if (dns_client_->GetConfig()) | 2349 if (dns_client_->GetConfig()) |
2346 UMA_HISTOGRAM_BOOLEAN("AsyncDNS.DnsClientEnabled", true); | 2350 UMA_HISTOGRAM_BOOLEAN("AsyncDNS.DnsClientEnabled", true); |
2347 } | 2351 } |
2348 | 2352 |
2349 AbortDnsTasks(); | 2353 AbortDnsTasks(); |
2350 } | 2354 } |
2351 | 2355 |
2352 } // namespace net | 2356 } // namespace net |
OLD | NEW |