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_BASE_DNSRR_RESOLVER_H_ | 5 #ifndef NET_BASE_DNSRR_RESOLVER_H_ |
6 #define NET_BASE_DNSRR_RESOLVER_H_ | 6 #define NET_BASE_DNSRR_RESOLVER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
11 #include <utility> | 11 #include <utility> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
16 #include "base/threading/non_thread_safe.h" | 16 #include "base/threading/non_thread_safe.h" |
17 #include "base/time.h" | 17 #include "base/time.h" |
18 #include "build/build_config.h" | 18 #include "build/build_config.h" |
19 #include "net/base/completion_callback.h" | 19 #include "net/base/completion_callback.h" |
20 #include "net/base/net_api.h" | 20 #include "net/base/net_export.h" |
21 #include "net/base/network_change_notifier.h" | 21 #include "net/base/network_change_notifier.h" |
22 | 22 |
23 namespace net { | 23 namespace net { |
24 | 24 |
25 // RRResponse contains the result of a successful request for a resource record. | 25 // RRResponse contains the result of a successful request for a resource record. |
26 struct NET_TEST RRResponse { | 26 struct NET_EXPORT_PRIVATE RRResponse { |
27 RRResponse(); | 27 RRResponse(); |
28 ~RRResponse(); | 28 ~RRResponse(); |
29 | 29 |
30 // HasExpired returns true if |fetch_time| + |ttl| is less than | 30 // HasExpired returns true if |fetch_time| + |ttl| is less than |
31 // |current_time|. | 31 // |current_time|. |
32 bool HasExpired(base::Time current_time) const; | 32 bool HasExpired(base::Time current_time) const; |
33 | 33 |
34 // For testing only | 34 // For testing only |
35 bool ParseFromResponse(const uint8* data, unsigned len, | 35 bool ParseFromResponse(const uint8* data, unsigned len, |
36 uint16 rrtype_requested); | 36 uint16 rrtype_requested); |
(...skipping 23 matching lines...) Expand all Loading... |
60 // DnsRRResolver resolves arbitary DNS resource record types. It should not be | 60 // DnsRRResolver resolves arbitary DNS resource record types. It should not be |
61 // confused with HostResolver and should not be used to resolve A/AAAA records. | 61 // confused with HostResolver and should not be used to resolve A/AAAA records. |
62 // | 62 // |
63 // HostResolver exists to lookup addresses and there are many details about | 63 // HostResolver exists to lookup addresses and there are many details about |
64 // address resolution over and above DNS (i.e. Bonjour, VPNs etc). | 64 // address resolution over and above DNS (i.e. Bonjour, VPNs etc). |
65 // | 65 // |
66 // DnsRRResolver should only be used when the data is specifically DNS data and | 66 // DnsRRResolver should only be used when the data is specifically DNS data and |
67 // the name is a fully qualified DNS domain. | 67 // the name is a fully qualified DNS domain. |
68 // | 68 // |
69 // A DnsRRResolver must be used from the MessageLoop which created it. | 69 // A DnsRRResolver must be used from the MessageLoop which created it. |
70 class NET_API DnsRRResolver : NON_EXPORTED_BASE(public base::NonThreadSafe), | 70 class NET_EXPORT DnsRRResolver |
71 public NetworkChangeNotifier::IPAddressObserver { | 71 : NON_EXPORTED_BASE(public base::NonThreadSafe), |
| 72 public NetworkChangeNotifier::IPAddressObserver { |
72 public: | 73 public: |
73 typedef intptr_t Handle; | 74 typedef intptr_t Handle; |
74 | 75 |
75 enum { | 76 enum { |
76 kInvalidHandle = 0, | 77 kInvalidHandle = 0, |
77 }; | 78 }; |
78 | 79 |
79 enum { | 80 enum { |
80 // Try harder to get a DNSSEC signed response. This doesn't mean that the | 81 // Try harder to get a DNSSEC signed response. This doesn't mean that the |
81 // RRResponse will always have the dnssec bit set. | 82 // RRResponse will always have the dnssec bit set. |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 uint64 inflight_joins_; | 129 uint64 inflight_joins_; |
129 | 130 |
130 bool in_destructor_; | 131 bool in_destructor_; |
131 | 132 |
132 DISALLOW_COPY_AND_ASSIGN(DnsRRResolver); | 133 DISALLOW_COPY_AND_ASSIGN(DnsRRResolver); |
133 }; | 134 }; |
134 | 135 |
135 } // namespace net | 136 } // namespace net |
136 | 137 |
137 #endif // NET_BASE_DNSRR_RESOLVER_H_ | 138 #endif // NET_BASE_DNSRR_RESOLVER_H_ |
OLD | NEW |