OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 1072 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1083 job_pools_[POOL_NORMAL] = new JobPool(max_jobs, 100u * max_jobs); | 1083 job_pools_[POOL_NORMAL] = new JobPool(max_jobs, 100u * max_jobs); |
1084 | 1084 |
1085 #if defined(OS_WIN) | 1085 #if defined(OS_WIN) |
1086 EnsureWinsockInit(); | 1086 EnsureWinsockInit(); |
1087 #endif | 1087 #endif |
1088 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 1088 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
1089 if (HaveOnlyLoopbackAddresses()) | 1089 if (HaveOnlyLoopbackAddresses()) |
1090 additional_resolver_flags_ |= HOST_RESOLVER_LOOPBACK_ONLY; | 1090 additional_resolver_flags_ |= HOST_RESOLVER_LOOPBACK_ONLY; |
1091 #endif | 1091 #endif |
1092 NetworkChangeNotifier::AddIPAddressObserver(this); | 1092 NetworkChangeNotifier::AddIPAddressObserver(this); |
1093 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) | 1093 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && !defined
(OS_ANDROID) |
1094 EnsureDnsReloaderInit(); | 1094 EnsureDnsReloaderInit(); |
1095 NetworkChangeNotifier::AddDNSObserver(this); | 1095 NetworkChangeNotifier::AddDNSObserver(this); |
1096 #endif | 1096 #endif |
1097 } | 1097 } |
1098 | 1098 |
1099 HostResolverImpl::~HostResolverImpl() { | 1099 HostResolverImpl::~HostResolverImpl() { |
1100 // Cancel the outstanding jobs. Those jobs may contain several attached | 1100 // Cancel the outstanding jobs. Those jobs may contain several attached |
1101 // requests, which will also be cancelled. | 1101 // requests, which will also be cancelled. |
1102 DiscardIPv6ProbeJob(); | 1102 DiscardIPv6ProbeJob(); |
1103 | 1103 |
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1654 // resolv.conf changes so we don't need to do anything to clear that cache. | 1654 // resolv.conf changes so we don't need to do anything to clear that cache. |
1655 if (cache_.get()) | 1655 if (cache_.get()) |
1656 cache_->clear(); | 1656 cache_->clear(); |
1657 // Existing jobs will have been sent to the original server so they need to | 1657 // Existing jobs will have been sent to the original server so they need to |
1658 // be aborted. TODO(Craig): Should these jobs be restarted? | 1658 // be aborted. TODO(Craig): Should these jobs be restarted? |
1659 AbortAllInProgressJobs(); | 1659 AbortAllInProgressJobs(); |
1660 // |this| may be deleted inside AbortAllInProgressJobs(). | 1660 // |this| may be deleted inside AbortAllInProgressJobs(). |
1661 } | 1661 } |
1662 | 1662 |
1663 } // namespace net | 1663 } // namespace net |
OLD | NEW |