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_H_ | 5 #ifndef NET_DNS_MDNS_CLIENT_H_ |
6 #define NET_DNS_MDNS_CLIENT_H_ | 6 #define NET_DNS_MDNS_CLIENT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 | 136 |
137 // Create a transaction that can be used to query either the MDns cache, the | 137 // Create a transaction that can be used to query either the MDns cache, the |
138 // network, or both for records of type |rrtype| and name |name|. |flags| is | 138 // network, or both for records of type |rrtype| and name |name|. |flags| is |
139 // defined by MDnsTransactionFlags. | 139 // defined by MDnsTransactionFlags. |
140 virtual scoped_ptr<MDnsTransaction> CreateTransaction( | 140 virtual scoped_ptr<MDnsTransaction> CreateTransaction( |
141 uint16 rrtype, | 141 uint16 rrtype, |
142 const std::string& name, | 142 const std::string& name, |
143 int flags, | 143 int flags, |
144 const MDnsTransaction::ResultCallback& callback) = 0; | 144 const MDnsTransaction::ResultCallback& callback) = 0; |
145 | 145 |
| 146 virtual bool StartListening() = 0; |
| 147 |
| 148 // Do not call this inside callbacks from related MDnsListener and |
| 149 // MDnsTransaction objects. |
| 150 virtual void StopListening() = 0; |
| 151 virtual bool IsListening() const = 0; |
| 152 |
146 // Lazily create and return static instance for MDnsClient. | 153 // Lazily create and return static instance for MDnsClient. |
147 static MDnsClient* GetInstance(); | 154 static MDnsClient* GetInstance(); |
148 | 155 |
149 // Set the global instance (for testing). MUST be called before the first call | 156 // Set the global instance (for testing). MUST be called before the first call |
150 // to GetInstance. | 157 // to GetInstance. |
151 static void SetInstance(MDnsClient* instance); | 158 static void SetInstance(MDnsClient* instance); |
152 }; | 159 }; |
153 | 160 |
154 } // namespace net | 161 } // namespace net |
155 #endif // NET_DNS_MDNS_CLIENT_H_ | 162 #endif // NET_DNS_MDNS_CLIENT_H_ |
OLD | NEW |