OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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_CLIENT_IMPL_H_ | 5 #ifndef NET_DNS_MDNS_CLIENT_IMPL_H_ |
6 #define NET_DNS_MDNS_CLIENT_IMPL_H_ | 6 #define NET_DNS_MDNS_CLIENT_IMPL_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 | 141 |
142 // Parse the response and alert relevant listeners. | 142 // Parse the response and alert relevant listeners. |
143 void HandlePacket(DnsResponse* response, int bytes_read) override; | 143 void HandlePacket(DnsResponse* response, int bytes_read) override; |
144 | 144 |
145 void OnConnectionError(int error) override; | 145 void OnConnectionError(int error) override; |
146 | 146 |
147 private: | 147 private: |
148 FRIEND_TEST_ALL_PREFIXES(MDnsTest, CacheCleanupWithShortTTL); | 148 FRIEND_TEST_ALL_PREFIXES(MDnsTest, CacheCleanupWithShortTTL); |
149 | 149 |
150 typedef std::pair<std::string, uint16_t> ListenerKey; | 150 typedef std::pair<std::string, uint16_t> ListenerKey; |
151 typedef std::map<ListenerKey, base::ObserverList<MDnsListenerImpl>*> | 151 typedef std::map<ListenerKey, |
| 152 std::unique_ptr<base::ObserverList<MDnsListenerImpl>>> |
152 ListenerMap; | 153 ListenerMap; |
153 | 154 |
154 // Alert listeners of an update to the cache. | 155 // Alert listeners of an update to the cache. |
155 void AlertListeners(MDnsCache::UpdateType update_type, | 156 void AlertListeners(MDnsCache::UpdateType update_type, |
156 const ListenerKey& key, const RecordParsed* record); | 157 const ListenerKey& key, const RecordParsed* record); |
157 | 158 |
158 // Schedule a cache cleanup to a specific time, cancelling other cleanups. | 159 // Schedule a cache cleanup to a specific time, cancelling other cleanups. |
159 void ScheduleCleanup(base::Time cleanup); | 160 void ScheduleCleanup(base::Time cleanup); |
160 | 161 |
161 // Clean up the cache and schedule a new cleanup. | 162 // Clean up the cache and schedule a new cleanup. |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 MDnsClientImpl* client_; | 326 MDnsClientImpl* client_; |
326 | 327 |
327 bool started_; | 328 bool started_; |
328 int flags_; | 329 int flags_; |
329 | 330 |
330 DISALLOW_COPY_AND_ASSIGN(MDnsTransactionImpl); | 331 DISALLOW_COPY_AND_ASSIGN(MDnsTransactionImpl); |
331 }; | 332 }; |
332 | 333 |
333 } // namespace net | 334 } // namespace net |
334 #endif // NET_DNS_MDNS_CLIENT_IMPL_H_ | 335 #endif // NET_DNS_MDNS_CLIENT_IMPL_H_ |
OLD | NEW |