| 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> |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 Handle Resolve(const std::string& name, uint16 rrtype, | 101 Handle Resolve(const std::string& name, uint16 rrtype, |
| 102 uint16 flags, const CompletionCallback& callback, | 102 uint16 flags, const CompletionCallback& callback, |
| 103 RRResponse* response, int priority, | 103 RRResponse* response, int priority, |
| 104 const BoundNetLog& netlog); | 104 const BoundNetLog& netlog); |
| 105 | 105 |
| 106 // CancelResolve cancels an inflight lookup. The callback for this lookup | 106 // CancelResolve cancels an inflight lookup. The callback for this lookup |
| 107 // must not have already been called. | 107 // must not have already been called. |
| 108 void CancelResolve(Handle handle); | 108 void CancelResolve(Handle handle); |
| 109 | 109 |
| 110 // Implementation of NetworkChangeNotifier::IPAddressObserver | 110 // Implementation of NetworkChangeNotifier::IPAddressObserver |
| 111 virtual void OnIPAddressChanged(); | 111 virtual void OnIPAddressChanged() OVERRIDE; |
| 112 | 112 |
| 113 private: | 113 private: |
| 114 friend class RRResolverWorker; | 114 friend class RRResolverWorker; |
| 115 | 115 |
| 116 void HandleResult(const std::string& name, uint16 rrtype, int result, | 116 void HandleResult(const std::string& name, uint16 rrtype, int result, |
| 117 const RRResponse& response); | 117 const RRResponse& response); |
| 118 | 118 |
| 119 // cache_ maps from a request to a cached response. The cached answer may | 119 // cache_ maps from a request to a cached response. The cached answer may |
| 120 // have expired and the size of |cache_| must be <= kMaxCacheEntries. | 120 // have expired and the size of |cache_| must be <= kMaxCacheEntries. |
| 121 // < name , rrtype> | 121 // < name , rrtype> |
| 122 std::map<std::pair<std::string, uint16>, RRResponse> cache_; | 122 std::map<std::pair<std::string, uint16>, RRResponse> cache_; |
| 123 // inflight_ maps from a request to an active resolution which is taking | 123 // inflight_ maps from a request to an active resolution which is taking |
| 124 // place. | 124 // place. |
| 125 std::map<std::pair<std::string, uint16>, RRResolverJob*> inflight_; | 125 std::map<std::pair<std::string, uint16>, RRResolverJob*> inflight_; |
| 126 | 126 |
| 127 uint64 requests_; | 127 uint64 requests_; |
| 128 uint64 cache_hits_; | 128 uint64 cache_hits_; |
| 129 uint64 inflight_joins_; | 129 uint64 inflight_joins_; |
| 130 | 130 |
| 131 bool in_destructor_; | 131 bool in_destructor_; |
| 132 | 132 |
| 133 DISALLOW_COPY_AND_ASSIGN(DnsRRResolver); | 133 DISALLOW_COPY_AND_ASSIGN(DnsRRResolver); |
| 134 }; | 134 }; |
| 135 | 135 |
| 136 } // namespace net | 136 } // namespace net |
| 137 | 137 |
| 138 #endif // NET_BASE_DNSRR_RESOLVER_H_ | 138 #endif // NET_BASE_DNSRR_RESOLVER_H_ |
| OLD | NEW |