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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 // invalidate the core. | 115 // invalidate the core. |
116 class Core : public base::SupportsWeakPtr<Core>, MDnsConnection::Delegate { | 116 class Core : public base::SupportsWeakPtr<Core>, MDnsConnection::Delegate { |
117 public: | 117 public: |
118 Core(base::Clock* clock, base::Timer* timer); | 118 Core(base::Clock* clock, base::Timer* timer); |
119 ~Core() override; | 119 ~Core() override; |
120 | 120 |
121 // Initialize the core. Returns true on success. | 121 // Initialize the core. Returns true on success. |
122 bool Init(MDnsSocketFactory* socket_factory); | 122 bool Init(MDnsSocketFactory* socket_factory); |
123 | 123 |
124 // Send a query with a specific rrtype and name. Returns true on success. | 124 // Send a query with a specific rrtype and name. Returns true on success. |
125 bool SendQuery(uint16 rrtype, std::string name); | 125 bool SendQuery(uint16 rrtype, const std::string& name); |
126 | 126 |
127 // Add/remove a listener to the list of listeners. | 127 // Add/remove a listener to the list of listeners. |
128 void AddListener(MDnsListenerImpl* listener); | 128 void AddListener(MDnsListenerImpl* listener); |
129 void RemoveListener(MDnsListenerImpl* listener); | 129 void RemoveListener(MDnsListenerImpl* listener); |
130 | 130 |
131 // Query the cache for records of a specific type and name. | 131 // Query the cache for records of a specific type and name. |
132 void QueryCache(uint16 rrtype, const std::string& name, | 132 void QueryCache(uint16 rrtype, const std::string& name, |
133 std::vector<const RecordParsed*>* records) const; | 133 std::vector<const RecordParsed*>* records) const; |
134 | 134 |
135 // Parse the response and alert relevant listeners. | 135 // Parse the response and alert relevant listeners. |
(...skipping 182 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 |