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 #ifndef NET_BASE_HOST_RESOLVER_PROC_H_ | 5 #ifndef NET_BASE_HOST_RESOLVER_PROC_H_ |
6 #define NET_BASE_HOST_RESOLVER_PROC_H_ | 6 #define NET_BASE_HOST_RESOLVER_PROC_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/ref_counted.h" | 10 #include "base/ref_counted.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 public: | 25 public: |
26 explicit HostResolverProc(HostResolverProc* previous); | 26 explicit HostResolverProc(HostResolverProc* previous); |
27 | 27 |
28 // Resolves |host| to an address list, restricting the results to addresses | 28 // Resolves |host| to an address list, restricting the results to addresses |
29 // in |address_family|. If successful returns OK and fills |addrlist| with | 29 // in |address_family|. If successful returns OK and fills |addrlist| with |
30 // a list of socket addresses. Otherwise returns a network error code. | 30 // a list of socket addresses. Otherwise returns a network error code. |
31 virtual int Resolve(const std::string& host, | 31 virtual int Resolve(const std::string& host, |
32 AddressFamily address_family, | 32 AddressFamily address_family, |
33 AddressList* addrlist) = 0; | 33 AddressList* addrlist) = 0; |
34 | 34 |
| 35 // Test to see if IPv6 is supported. |
| 36 static bool IPv6Supported(); |
| 37 |
35 protected: | 38 protected: |
36 friend class base::RefCountedThreadSafe<HostResolverProc>; | 39 friend class base::RefCountedThreadSafe<HostResolverProc>; |
37 | 40 |
38 virtual ~HostResolverProc() {} | 41 virtual ~HostResolverProc() {} |
39 | 42 |
40 // Asks the fallback procedure (if set) to do the resolve. | 43 // Asks the fallback procedure (if set) to do the resolve. |
41 int ResolveUsingPrevious(const std::string& host, | 44 int ResolveUsingPrevious(const std::string& host, |
42 AddressFamily address_family, | 45 AddressFamily address_family, |
43 AddressList* addrlist); | 46 AddressList* addrlist); |
44 | 47 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 // (i.e. this calls out to getaddrinfo()). If successful returns OK and fills | 79 // (i.e. this calls out to getaddrinfo()). If successful returns OK and fills |
77 // |addrlist| with a list of socket addresses. Otherwise returns a | 80 // |addrlist| with a list of socket addresses. Otherwise returns a |
78 // network error code. | 81 // network error code. |
79 int SystemHostResolverProc(const std::string& host, | 82 int SystemHostResolverProc(const std::string& host, |
80 AddressFamily address_family, | 83 AddressFamily address_family, |
81 AddressList* addrlist); | 84 AddressList* addrlist); |
82 | 85 |
83 } // namespace net | 86 } // namespace net |
84 | 87 |
85 #endif // NET_BASE_HOST_RESOLVER_PROC_H_ | 88 #endif // NET_BASE_HOST_RESOLVER_PROC_H_ |
OLD | NEW |