| 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 1064 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1075 | 1075 |
| 1076 #if defined(OS_WIN) | 1076 #if defined(OS_WIN) |
| 1077 EnsureWinsockInit(); | 1077 EnsureWinsockInit(); |
| 1078 #endif | 1078 #endif |
| 1079 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 1079 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 1080 if (HaveOnlyLoopbackAddresses()) | 1080 if (HaveOnlyLoopbackAddresses()) |
| 1081 additional_resolver_flags_ |= HOST_RESOLVER_LOOPBACK_ONLY; | 1081 additional_resolver_flags_ |= HOST_RESOLVER_LOOPBACK_ONLY; |
| 1082 #endif | 1082 #endif |
| 1083 NetworkChangeNotifier::AddIPAddressObserver(this); | 1083 NetworkChangeNotifier::AddIPAddressObserver(this); |
| 1084 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) | 1084 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) |
| 1085 #if !defined(OS_ANDROID) |
| 1085 EnsureDnsReloaderInit(); | 1086 EnsureDnsReloaderInit(); |
| 1087 #endif |
| 1086 NetworkChangeNotifier::AddDNSObserver(this); | 1088 NetworkChangeNotifier::AddDNSObserver(this); |
| 1087 #endif | 1089 #endif |
| 1088 } | 1090 } |
| 1089 | 1091 |
| 1090 HostResolverImpl::~HostResolverImpl() { | 1092 HostResolverImpl::~HostResolverImpl() { |
| 1091 // Cancel the outstanding jobs. Those jobs may contain several attached | 1093 // Cancel the outstanding jobs. Those jobs may contain several attached |
| 1092 // requests, which will also be cancelled. | 1094 // requests, which will also be cancelled. |
| 1093 DiscardIPv6ProbeJob(); | 1095 DiscardIPv6ProbeJob(); |
| 1094 | 1096 |
| 1095 CancelAllJobs(); | 1097 CancelAllJobs(); |
| (...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1592 // resolv.conf changes so we don't need to do anything to clear that cache. | 1594 // resolv.conf changes so we don't need to do anything to clear that cache. |
| 1593 if (cache_.get()) | 1595 if (cache_.get()) |
| 1594 cache_->clear(); | 1596 cache_->clear(); |
| 1595 // Existing jobs will have been sent to the original server so they need to | 1597 // Existing jobs will have been sent to the original server so they need to |
| 1596 // be aborted. TODO(Craig): Should these jobs be restarted? | 1598 // be aborted. TODO(Craig): Should these jobs be restarted? |
| 1597 AbortAllInProgressJobs(); | 1599 AbortAllInProgressJobs(); |
| 1598 // |this| may be deleted inside AbortAllInProgressJobs(). | 1600 // |this| may be deleted inside AbortAllInProgressJobs(). |
| 1599 } | 1601 } |
| 1600 | 1602 |
| 1601 } // namespace net | 1603 } // namespace net |
| OLD | NEW |