OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1125 return default_address_family_; | 1125 return default_address_family_; |
1126 } | 1126 } |
1127 | 1127 |
1128 void HostResolverImpl::ProbeIPv6Support() { | 1128 void HostResolverImpl::ProbeIPv6Support() { |
1129 DCHECK(CalledOnValidThread()); | 1129 DCHECK(CalledOnValidThread()); |
1130 DCHECK(!ipv6_probe_monitoring_); | 1130 DCHECK(!ipv6_probe_monitoring_); |
1131 ipv6_probe_monitoring_ = true; | 1131 ipv6_probe_monitoring_ = true; |
1132 OnIPAddressChanged(); // Give initial setup call. | 1132 OnIPAddressChanged(); // Give initial setup call. |
1133 } | 1133 } |
1134 | 1134 |
| 1135 HostResolverImpl* HostResolverImpl::GetAsHostResolverImpl() { |
| 1136 return this; |
| 1137 } |
| 1138 |
1135 void HostResolverImpl::Shutdown() { | 1139 void HostResolverImpl::Shutdown() { |
1136 DCHECK(CalledOnValidThread()); | 1140 DCHECK(CalledOnValidThread()); |
1137 | 1141 |
1138 // Cancel the outstanding jobs. | 1142 // Cancel the outstanding jobs. |
1139 CancelAllJobs(); | 1143 CancelAllJobs(); |
1140 DiscardIPv6ProbeJob(); | 1144 DiscardIPv6ProbeJob(); |
1141 | 1145 |
1142 shutdown_ = true; | 1146 shutdown_ = true; |
1143 } | 1147 } |
1144 | 1148 |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1448 job_pools_[i]->ResetNumOutstandingJobs(); | 1452 job_pools_[i]->ResetNumOutstandingJobs(); |
1449 JobMap jobs; | 1453 JobMap jobs; |
1450 jobs.swap(jobs_); | 1454 jobs.swap(jobs_); |
1451 for (JobMap::iterator it = jobs.begin(); it != jobs.end(); ++it) { | 1455 for (JobMap::iterator it = jobs.begin(); it != jobs.end(); ++it) { |
1452 AbortJob(it->second); | 1456 AbortJob(it->second); |
1453 it->second->Cancel(); | 1457 it->second->Cancel(); |
1454 } | 1458 } |
1455 } | 1459 } |
1456 | 1460 |
1457 } // namespace net | 1461 } // namespace net |
OLD | NEW |