| 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 889 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   900  |   900  | 
|   901 void HostResolverImpl::ProbeIPv6Support() { |   901 void HostResolverImpl::ProbeIPv6Support() { | 
|   902   DCHECK(CalledOnValidThread()); |   902   DCHECK(CalledOnValidThread()); | 
|   903   DCHECK(!ipv6_probe_monitoring_); |   903   DCHECK(!ipv6_probe_monitoring_); | 
|   904   ipv6_probe_monitoring_ = true; |   904   ipv6_probe_monitoring_ = true; | 
|   905   OnIPAddressChanged();  // Give initial setup call. |   905   OnIPAddressChanged();  // Give initial setup call. | 
|   906 } |   906 } | 
|   907  |   907  | 
|   908 void HostResolverImpl::Shutdown() { |   908 void HostResolverImpl::Shutdown() { | 
|   909   DCHECK(CalledOnValidThread()); |   909   DCHECK(CalledOnValidThread()); | 
|   910   shutdown_ = true; |  | 
|   911  |   910  | 
|   912   // Cancel the outstanding jobs. |   911   // Cancel the outstanding jobs. | 
|   913   for (JobMap::iterator it = jobs_.begin(); it != jobs_.end(); ++it) |   912   for (JobMap::iterator it = jobs_.begin(); it != jobs_.end(); ++it) | 
|   914     it->second->Cancel(); |   913     it->second->Cancel(); | 
|   915   jobs_.clear(); |   914   jobs_.clear(); | 
|   916   DiscardIPv6ProbeJob(); |   915   DiscardIPv6ProbeJob(); | 
 |   916  | 
 |   917   shutdown_ = true; | 
|   917 } |   918 } | 
|   918  |   919  | 
|   919 void HostResolverImpl::SetPoolConstraints(JobPoolIndex pool_index, |   920 void HostResolverImpl::SetPoolConstraints(JobPoolIndex pool_index, | 
|   920                                           size_t max_outstanding_jobs, |   921                                           size_t max_outstanding_jobs, | 
|   921                                           size_t max_pending_requests) { |   922                                           size_t max_pending_requests) { | 
|   922   DCHECK(CalledOnValidThread()); |   923   DCHECK(CalledOnValidThread()); | 
|   923   CHECK_GE(pool_index, 0); |   924   CHECK_GE(pool_index, 0); | 
|   924   CHECK_LT(pool_index, POOL_COUNT); |   925   CHECK_LT(pool_index, POOL_COUNT); | 
|   925   CHECK(jobs_.empty()) << "Can only set constraints during setup"; |   926   CHECK(jobs_.empty()) << "Can only set constraints during setup"; | 
|   926   JobPool* pool = job_pools_[pool_index]; |   927   JobPool* pool = job_pools_[pool_index]; | 
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1165     if (r == req) |  1166     if (r == req) | 
|  1166       return error; |  1167       return error; | 
|  1167  |  1168  | 
|  1168     r->OnComplete(error, AddressList()); |  1169     r->OnComplete(error, AddressList()); | 
|  1169   } |  1170   } | 
|  1170  |  1171  | 
|  1171   return ERR_IO_PENDING; |  1172   return ERR_IO_PENDING; | 
|  1172 } |  1173 } | 
|  1173  |  1174  | 
|  1174 }  // namespace net |  1175 }  // namespace net | 
| OLD | NEW |