Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(758)

Side by Side Diff: net/dns/mdns_client.h

Issue 17922002: Add an explicit way of forcing the MDnsClient to listen on the network (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « chrome/browser/local_discovery/service_discovery_client_unittest.cc ('k') | net/dns/mdns_client_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698