OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_DNS_CLIENT_H_ | 5 #ifndef NET_DNS_DNS_CLIENT_H_ |
6 #define NET_DNS_DNS_CLIENT_H_ | 6 #define NET_DNS_DNS_CLIENT_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "net/base/net_export.h" | 10 #include "net/base/net_export.h" |
11 | 11 |
12 namespace net { | 12 namespace net { |
13 | 13 |
| 14 class AddressSorter; |
14 struct DnsConfig; | 15 struct DnsConfig; |
15 class DnsTransactionFactory; | 16 class DnsTransactionFactory; |
16 class NetLog; | 17 class NetLog; |
17 | 18 |
18 // Convenience wrapper allows easy injection of DnsTransaction into | 19 // Convenience wrapper allows easy injection of DnsTransaction into |
19 // HostResolverImpl. | 20 // HostResolverImpl. |
20 class NET_EXPORT DnsClient { | 21 class NET_EXPORT DnsClient { |
21 public: | 22 public: |
22 virtual ~DnsClient() {} | 23 virtual ~DnsClient() {} |
23 | 24 |
24 // Creates a new DnsTransactionFactory according to the new |config|. | 25 // Creates a new DnsTransactionFactory according to the new |config|. |
25 virtual void SetConfig(const DnsConfig& config) = 0; | 26 virtual void SetConfig(const DnsConfig& config) = 0; |
26 | 27 |
27 // Returns NULL if the current config is not valid. | 28 // Returns NULL if the current config is not valid. |
28 virtual const DnsConfig* GetConfig() const = 0; | 29 virtual const DnsConfig* GetConfig() const = 0; |
29 | 30 |
30 // Returns NULL if the current config is not valid. | 31 // Returns NULL if the current config is not valid. |
31 virtual DnsTransactionFactory* GetTransactionFactory() = 0; | 32 virtual DnsTransactionFactory* GetTransactionFactory() = 0; |
32 | 33 |
| 34 virtual AddressSorter* GetAddressSorter() = 0; |
| 35 |
33 // Creates default client. | 36 // Creates default client. |
34 static scoped_ptr<DnsClient> CreateClient(NetLog* net_log); | 37 static scoped_ptr<DnsClient> CreateClient(NetLog* net_log); |
35 }; | 38 }; |
36 | 39 |
37 } // namespace net | 40 } // namespace net |
38 | 41 |
39 #endif // NET_DNS_DNS_CLIENT_H_ | 42 #endif // NET_DNS_DNS_CLIENT_H_ |
40 | 43 |
OLD | NEW |