| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_MDNS_CACHE_H_ | 5 #ifndef NET_DNS_MDNS_CACHE_H_ |
| 6 #define NET_DNS_MDNS_CACHE_H_ | 6 #define NET_DNS_MDNS_CACHE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/callback.h" | 13 #include "base/callback.h" |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
| 16 #include "net/base/net_export.h" | 16 #include "net/base/net_export.h" |
| 17 | 17 |
| 18 namespace net { | 18 namespace net { |
| 19 | 19 |
| 20 class ParsedDnsRecord; | |
| 21 class RecordParsed; | 20 class RecordParsed; |
| 22 | 21 |
| 23 // mDNS Cache | 22 // mDNS Cache |
| 24 // This is a cache of mDNS records. It keeps track of expiration times and is | 23 // This is a cache of mDNS records. It keeps track of expiration times and is |
| 25 // guaranteed not to return expired records. It also has facilities for timely | 24 // guaranteed not to return expired records. It also has facilities for timely |
| 26 // record expiration. | 25 // record expiration. |
| 27 class NET_EXPORT_PRIVATE MDnsCache { | 26 class NET_EXPORT_PRIVATE MDnsCache { |
| 28 public: | 27 public: |
| 29 // Key type for the record map. It is a 3-tuple of type, name and optional | 28 // Key type for the record map. It is a 3-tuple of type, name and optional |
| 30 // value ordered by type, then name, then optional value. This allows us to | 29 // value ordered by type, then name, then optional value. This allows us to |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 RecordMap mdns_cache_; | 108 RecordMap mdns_cache_; |
| 110 | 109 |
| 111 base::Time next_expiration_; | 110 base::Time next_expiration_; |
| 112 | 111 |
| 113 DISALLOW_COPY_AND_ASSIGN(MDnsCache); | 112 DISALLOW_COPY_AND_ASSIGN(MDnsCache); |
| 114 }; | 113 }; |
| 115 | 114 |
| 116 } // namespace net | 115 } // namespace net |
| 117 | 116 |
| 118 #endif // NET_DNS_MDNS_CACHE_H_ | 117 #endif // NET_DNS_MDNS_CACHE_H_ |
| OLD | NEW |