| 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.h" | 5 #include "net/base/host_resolver.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "net/base/net_errors.h" | 9 #include "net/base/net_errors.h" |
| 10 | 10 |
| 11 namespace net { | 11 namespace net { |
| 12 | 12 |
| 13 HostResolver::RequestInfo::RequestInfo(const HostPortPair& host_port_pair) | 13 HostResolver::RequestInfo::RequestInfo(const HostPortPair& host_port_pair) |
| 14 : host_port_pair_(host_port_pair), | 14 : host_port_pair_(host_port_pair), |
| 15 address_family_(ADDRESS_FAMILY_UNSPECIFIED), | 15 address_family_(ADDRESS_FAMILY_UNSPECIFIED), |
| 16 host_resolver_flags_(0), | 16 host_resolver_flags_(0), |
| 17 allow_cached_response_(true), | 17 allow_cached_response_(true), |
| 18 is_speculative_(false), | 18 is_speculative_(false), |
| 19 priority_(MEDIUM) { | 19 priority_(MEDIUM) { |
| 20 } | 20 } |
| 21 | 21 |
| 22 HostResolver::HostResolver() { | |
| 23 } | |
| 24 | |
| 25 HostResolver::~HostResolver() { | 22 HostResolver::~HostResolver() { |
| 26 } | 23 } |
| 27 | 24 |
| 28 AddressFamily HostResolver::GetDefaultAddressFamily() const { | 25 AddressFamily HostResolver::GetDefaultAddressFamily() const { |
| 29 return net::ADDRESS_FAMILY_UNSPECIFIED; | 26 return net::ADDRESS_FAMILY_UNSPECIFIED; |
| 30 } | 27 } |
| 31 | 28 |
| 32 HostResolverImpl* HostResolver::GetAsHostResolverImpl() { | 29 HostResolverImpl* HostResolver::GetAsHostResolverImpl() { |
| 33 return NULL; | 30 return NULL; |
| 34 } | 31 } |
| 35 | 32 |
| 33 HostResolver::HostResolver() { |
| 34 } |
| 35 |
| 36 SingleRequestHostResolver::SingleRequestHostResolver(HostResolver* resolver) | 36 SingleRequestHostResolver::SingleRequestHostResolver(HostResolver* resolver) |
| 37 : resolver_(resolver), | 37 : resolver_(resolver), |
| 38 cur_request_(NULL), | 38 cur_request_(NULL), |
| 39 cur_request_callback_(NULL), | 39 cur_request_callback_(NULL), |
| 40 ALLOW_THIS_IN_INITIALIZER_LIST( | 40 ALLOW_THIS_IN_INITIALIZER_LIST( |
| 41 callback_(this, &SingleRequestHostResolver::OnResolveCompletion)) { | 41 callback_(this, &SingleRequestHostResolver::OnResolveCompletion)) { |
| 42 DCHECK(resolver_ != NULL); | 42 DCHECK(resolver_ != NULL); |
| 43 } | 43 } |
| 44 | 44 |
| 45 SingleRequestHostResolver::~SingleRequestHostResolver() { | 45 SingleRequestHostResolver::~SingleRequestHostResolver() { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 | 84 |
| 85 // Clear the outstanding request information. | 85 // Clear the outstanding request information. |
| 86 cur_request_ = NULL; | 86 cur_request_ = NULL; |
| 87 cur_request_callback_ = NULL; | 87 cur_request_callback_ = NULL; |
| 88 | 88 |
| 89 // Call the user's original callback. | 89 // Call the user's original callback. |
| 90 callback->Run(result); | 90 callback->Run(result); |
| 91 } | 91 } |
| 92 | 92 |
| 93 } // namespace net | 93 } // namespace net |
| OLD | NEW |