OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_DNS_ASYNC_HOST_RESOLVER_H_ | 5 #ifndef NET_DNS_ASYNC_HOST_RESOLVER_H_ |
6 #define NET_DNS_ASYNC_HOST_RESOLVER_H_ | 6 #define NET_DNS_ASYNC_HOST_RESOLVER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <list> | 9 #include <list> |
10 #include <map> | 10 #include <map> |
(...skipping 21 matching lines...) Expand all Loading... |
32 size_t max_pending_requests_, | 32 size_t max_pending_requests_, |
33 const RandIntCallback& rand_int, | 33 const RandIntCallback& rand_int, |
34 HostCache* cache, | 34 HostCache* cache, |
35 ClientSocketFactory* factory, | 35 ClientSocketFactory* factory, |
36 NetLog* net_log); | 36 NetLog* net_log); |
37 virtual ~AsyncHostResolver(); | 37 virtual ~AsyncHostResolver(); |
38 | 38 |
39 // HostResolver interface | 39 // HostResolver interface |
40 virtual int Resolve(const RequestInfo& info, | 40 virtual int Resolve(const RequestInfo& info, |
41 AddressList* addresses, | 41 AddressList* addresses, |
42 OldCompletionCallback* callback, | 42 const CompletionCallback& callback, |
43 RequestHandle* out_req, | 43 RequestHandle* out_req, |
44 const BoundNetLog& source_net_log) OVERRIDE; | 44 const BoundNetLog& source_net_log) OVERRIDE; |
45 virtual int ResolveFromCache(const RequestInfo& info, | 45 virtual int ResolveFromCache(const RequestInfo& info, |
46 AddressList* addresses, | 46 AddressList* addresses, |
47 const BoundNetLog& source_net_log) OVERRIDE; | 47 const BoundNetLog& source_net_log) OVERRIDE; |
48 virtual void CancelRequest(RequestHandle req_handle) OVERRIDE; | 48 virtual void CancelRequest(RequestHandle req_handle) OVERRIDE; |
49 virtual void SetDefaultAddressFamily(AddressFamily address_family) OVERRIDE; | 49 virtual void SetDefaultAddressFamily(AddressFamily address_family) OVERRIDE; |
50 virtual AddressFamily GetDefaultAddressFamily() const OVERRIDE; | 50 virtual AddressFamily GetDefaultAddressFamily() const OVERRIDE; |
51 virtual HostCache* GetHostCache() OVERRIDE; | 51 virtual HostCache* GetHostCache() OVERRIDE; |
52 | 52 |
(...skipping 15 matching lines...) Expand all Loading... |
68 | 68 |
69 class Request; | 69 class Request; |
70 | 70 |
71 typedef DnsTransaction::Key Key; | 71 typedef DnsTransaction::Key Key; |
72 typedef std::list<Request*> RequestList; | 72 typedef std::list<Request*> RequestList; |
73 typedef std::list<const DnsTransaction*> TransactionList; | 73 typedef std::list<const DnsTransaction*> TransactionList; |
74 typedef std::map<Key, RequestList> KeyRequestListMap; | 74 typedef std::map<Key, RequestList> KeyRequestListMap; |
75 | 75 |
76 // Create a new request for the incoming Resolve() call. | 76 // Create a new request for the incoming Resolve() call. |
77 Request* CreateNewRequest(const RequestInfo& info, | 77 Request* CreateNewRequest(const RequestInfo& info, |
78 OldCompletionCallback* callback, | 78 const CompletionCallback& callback, |
79 AddressList* addresses, | 79 AddressList* addresses, |
80 const BoundNetLog& source_net_log); | 80 const BoundNetLog& source_net_log); |
81 | 81 |
82 // Called when a request has just been started. | 82 // Called when a request has just been started. |
83 void OnStart(Request* request); | 83 void OnStart(Request* request); |
84 | 84 |
85 // Called when a request has just completed (before its callback is run). | 85 // Called when a request has just completed (before its callback is run). |
86 void OnFinish(Request* request, int result); | 86 void OnFinish(Request* request, int result); |
87 | 87 |
88 // Called when a request has been cancelled. | 88 // Called when a request has been cancelled. |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 ClientSocketFactory* factory_; | 143 ClientSocketFactory* factory_; |
144 | 144 |
145 NetLog* net_log_; | 145 NetLog* net_log_; |
146 | 146 |
147 DISALLOW_COPY_AND_ASSIGN(AsyncHostResolver); | 147 DISALLOW_COPY_AND_ASSIGN(AsyncHostResolver); |
148 }; | 148 }; |
149 | 149 |
150 } // namespace net | 150 } // namespace net |
151 | 151 |
152 #endif // NET_DNS_ASYNC_HOST_RESOLVER_H_ | 152 #endif // NET_DNS_ASYNC_HOST_RESOLVER_H_ |
OLD | NEW |