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 <map> | 8 #include <map> |
9 #include <queue> | 9 #include <queue> |
10 #include <string> | 10 #include <string> |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 | 134 |
135 // Parse the response and alert relevant listeners. | 135 // Parse the response and alert relevant listeners. |
136 void HandlePacket(DnsResponse* response, int bytes_read) override; | 136 void HandlePacket(DnsResponse* response, int bytes_read) override; |
137 | 137 |
138 void OnConnectionError(int error) override; | 138 void OnConnectionError(int error) override; |
139 | 139 |
140 private: | 140 private: |
141 FRIEND_TEST_ALL_PREFIXES(MDnsTest, CacheCleanupWithShortTTL); | 141 FRIEND_TEST_ALL_PREFIXES(MDnsTest, CacheCleanupWithShortTTL); |
142 | 142 |
143 typedef std::pair<std::string, uint16> ListenerKey; | 143 typedef std::pair<std::string, uint16> ListenerKey; |
144 typedef std::map<ListenerKey, ObserverList<MDnsListenerImpl>* > | 144 typedef std::map<ListenerKey, base::ObserverList<MDnsListenerImpl>*> |
145 ListenerMap; | 145 ListenerMap; |
146 | 146 |
147 // Alert listeners of an update to the cache. | 147 // Alert listeners of an update to the cache. |
148 void AlertListeners(MDnsCache::UpdateType update_type, | 148 void AlertListeners(MDnsCache::UpdateType update_type, |
149 const ListenerKey& key, const RecordParsed* record); | 149 const ListenerKey& key, const RecordParsed* record); |
150 | 150 |
151 // Schedule a cache cleanup to a specific time, cancelling other cleanups. | 151 // Schedule a cache cleanup to a specific time, cancelling other cleanups. |
152 void ScheduleCleanup(base::Time cleanup); | 152 void ScheduleCleanup(base::Time cleanup); |
153 | 153 |
154 // Clean up the cache and schedule a new cleanup. | 154 // Clean up the cache and schedule a new cleanup. |
155 void DoCleanup(); | 155 void DoCleanup(); |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 MDnsClientImpl* client_; | 318 MDnsClientImpl* client_; |
319 | 319 |
320 bool started_; | 320 bool started_; |
321 int flags_; | 321 int flags_; |
322 | 322 |
323 DISALLOW_COPY_AND_ASSIGN(MDnsTransactionImpl); | 323 DISALLOW_COPY_AND_ASSIGN(MDnsTransactionImpl); |
324 }; | 324 }; |
325 | 325 |
326 } // namespace net | 326 } // namespace net |
327 #endif // NET_DNS_MDNS_CLIENT_IMPL_H_ | 327 #endif // NET_DNS_MDNS_CLIENT_IMPL_H_ |
OLD | NEW |