| 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/base/host_resolver_impl.h" | 5 #include "net/base/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 1365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1376 | 1376 |
| 1377 net_log_.EndEventWithNetErrorCode(NetLog::TYPE_HOST_RESOLVER_IMPL_JOB, | 1377 net_log_.EndEventWithNetErrorCode(NetLog::TYPE_HOST_RESOLVER_IMPL_JOB, |
| 1378 net_error); | 1378 net_error); |
| 1379 | 1379 |
| 1380 DCHECK(!requests_.empty()); | 1380 DCHECK(!requests_.empty()); |
| 1381 | 1381 |
| 1382 if (net_error == OK) { | 1382 if (net_error == OK) { |
| 1383 SetPortOnAddressList(requests_->front()->info().port(), &list); | 1383 SetPortOnAddressList(requests_->front()->info().port(), &list); |
| 1384 // Record this histogram here, when we know the system has a valid DNS | 1384 // Record this histogram here, when we know the system has a valid DNS |
| 1385 // configuration. | 1385 // configuration. |
| 1386 UMA_HISTOGRAM_ENUMERATION("AsyncDNS.HaveDnsConfig", | 1386 UMA_HISTOGRAM_BOOLEAN("AsyncDNS.HaveDnsConfig", |
| 1387 resolver_->received_dns_config_ ? 1 : 0, | 1387 resolver_->received_dns_config_); |
| 1388 2); | |
| 1389 } | 1388 } |
| 1390 | 1389 |
| 1391 if ((net_error != ERR_ABORTED) && | 1390 if ((net_error != ERR_ABORTED) && |
| 1392 (net_error != ERR_HOST_RESOLVER_QUEUE_TOO_LARGE)) { | 1391 (net_error != ERR_HOST_RESOLVER_QUEUE_TOO_LARGE)) { |
| 1393 resolver_->CacheResult(key_, net_error, list, ttl); | 1392 resolver_->CacheResult(key_, net_error, list, ttl); |
| 1394 } | 1393 } |
| 1395 | 1394 |
| 1396 // Complete all of the requests that were attached to the job. | 1395 // Complete all of the requests that were attached to the job. |
| 1397 for (RequestsList::const_iterator it = requests_.begin(); | 1396 for (RequestsList::const_iterator it = requests_.begin(); |
| 1398 it != requests_.end(); ++it) { | 1397 it != requests_.end(); ++it) { |
| (...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1930 if (self) | 1929 if (self) |
| 1931 TryServingAllJobsFromHosts(); | 1930 TryServingAllJobsFromHosts(); |
| 1932 } | 1931 } |
| 1933 } | 1932 } |
| 1934 | 1933 |
| 1935 bool HostResolverImpl::HaveDnsConfig() const { | 1934 bool HostResolverImpl::HaveDnsConfig() const { |
| 1936 return (dns_client_.get() != NULL) && (dns_client_->GetConfig() != NULL); | 1935 return (dns_client_.get() != NULL) && (dns_client_->GetConfig() != NULL); |
| 1937 } | 1936 } |
| 1938 | 1937 |
| 1939 } // namespace net | 1938 } // namespace net |
| OLD | NEW |