Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_MDNS_NSD_REGISTRY_H_ | |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_MDNS_NSD_REGISTRY_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 #include <vector> | |
| 10 | |
| 11 #include "base/observer_list.h" | |
| 12 | |
| 13 namespace extensions { | |
| 14 | |
| 15 // Network Service Discovery registry class for keeping track of local network | |
|
mark a. foltz
2013/08/30 01:35:52
remove the first 'local' as it seems redundant
justinlin
2013/09/03 21:21:56
Done.
| |
| 16 // services discovered on the local network. | |
|
mark a. foltz
2013/08/30 01:35:52
You may want to drop a URL to the NSD spec as a po
justinlin
2013/09/03 21:21:56
Done.
| |
| 17 class NsdRegistry { | |
| 18 public: | |
| 19 typedef std::vector<std::string> NsdServiceList; | |
| 20 | |
| 21 class NsdObserver { | |
| 22 public: | |
| 23 virtual void OnMDnsEvent(const std::string& service_type, | |
| 24 const NsdServiceList& services) = 0; | |
| 25 | |
| 26 protected: | |
| 27 virtual ~NsdObserver() {} | |
| 28 }; | |
| 29 | |
| 30 explicit NsdRegistry(); | |
| 31 virtual ~NsdRegistry(); | |
| 32 | |
| 33 // Observer registration for parties interested in discovery events. | |
| 34 virtual void AddObserver(NsdObserver* observer); | |
| 35 virtual void RemoveObserver(NsdObserver* observer); | |
| 36 | |
| 37 // MDNS-related discovery functionality. | |
| 38 virtual void RegisterMDnsListener(std::string serviceName); | |
| 39 virtual void UnregisterMDnsListener(std::string serviceName); | |
| 40 | |
| 41 protected: | |
| 42 ObserverList<NsdObserver> observers_; | |
| 43 }; | |
| 44 | |
| 45 } // namespace extensions | |
| 46 | |
| 47 #endif // CHROME_BROWSER_EXTENSIONS_API_MDNS_NSD_REGISTRY_H_ | |
| OLD | NEW |