| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 <ws2tcpip.h> | 8 #include <ws2tcpip.h> |
| 9 #include <wspiapi.h> // Needed for Win2k compat. | 9 #include <wspiapi.h> // Needed for Win2k compat. |
| 10 #elif defined(OS_POSIX) | 10 #elif defined(OS_POSIX) |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 for (JobMap::iterator it = jobs_.begin(); it != jobs_.end(); ++it) | 282 for (JobMap::iterator it = jobs_.begin(); it != jobs_.end(); ++it) |
| 283 it->second->Cancel(); | 283 it->second->Cancel(); |
| 284 | 284 |
| 285 // In case we are being deleted during the processing of a callback. | 285 // In case we are being deleted during the processing of a callback. |
| 286 if (cur_completing_job_) | 286 if (cur_completing_job_) |
| 287 cur_completing_job_->Cancel(); | 287 cur_completing_job_->Cancel(); |
| 288 } | 288 } |
| 289 | 289 |
| 290 // TODO(eroman): Don't create cache entries for hostnames which are simply IP | 290 // TODO(eroman): Don't create cache entries for hostnames which are simply IP |
| 291 // address literals. | 291 // address literals. |
| 292 int HostResolverImpl::Resolve(const RequestInfo& info, | 292 int HostResolverImpl::Resolve(LoadLog* load_log, |
| 293 const RequestInfo& info, |
| 293 AddressList* addresses, | 294 AddressList* addresses, |
| 294 CompletionCallback* callback, | 295 CompletionCallback* callback, |
| 295 RequestHandle* out_req) { | 296 RequestHandle* out_req) { |
| 296 if (shutdown_) | 297 if (shutdown_) |
| 297 return ERR_UNEXPECTED; | 298 return ERR_UNEXPECTED; |
| 298 | 299 |
| 299 // Choose a unique ID number for observers to see. | 300 // Choose a unique ID number for observers to see. |
| 300 int request_id = next_request_id_++; | 301 int request_id = next_request_id_++; |
| 301 | 302 |
| 302 // Notify registered observers. | 303 // Notify registered observers. |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 | 484 |
| 484 void HostResolverImpl::NotifyObserversCancelRequest(int request_id, | 485 void HostResolverImpl::NotifyObserversCancelRequest(int request_id, |
| 485 const RequestInfo& info) { | 486 const RequestInfo& info) { |
| 486 for (ObserversList::iterator it = observers_.begin(); | 487 for (ObserversList::iterator it = observers_.begin(); |
| 487 it != observers_.end(); ++it) { | 488 it != observers_.end(); ++it) { |
| 488 (*it)->OnCancelResolution(request_id, info); | 489 (*it)->OnCancelResolution(request_id, info); |
| 489 } | 490 } |
| 490 } | 491 } |
| 491 | 492 |
| 492 } // namespace net | 493 } // namespace net |
| OLD | NEW |