Chromium Code Reviews| Index: chrome/browser/extensions/api/mdns/nsd_registry.h |
| diff --git a/chrome/browser/extensions/api/mdns/nsd_registry.h b/chrome/browser/extensions/api/mdns/nsd_registry.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..7d527964e21280ce76b7f71d51c82818b306db36 |
| --- /dev/null |
| +++ b/chrome/browser/extensions/api/mdns/nsd_registry.h |
| @@ -0,0 +1,47 @@ |
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_EXTENSIONS_API_MDNS_NSD_REGISTRY_H_ |
| +#define CHROME_BROWSER_EXTENSIONS_API_MDNS_NSD_REGISTRY_H_ |
| + |
| +#include <string> |
| +#include <vector> |
| + |
| +#include "base/observer_list.h" |
| + |
| +namespace extensions { |
| + |
| +// 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.
|
| +// 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.
|
| +class NsdRegistry { |
| + public: |
| + typedef std::vector<std::string> NsdServiceList; |
| + |
| + class NsdObserver { |
| + public: |
| + virtual void OnMDnsEvent(const std::string& service_type, |
| + const NsdServiceList& services) = 0; |
| + |
| + protected: |
| + virtual ~NsdObserver() {} |
| + }; |
| + |
| + explicit NsdRegistry(); |
| + virtual ~NsdRegistry(); |
| + |
| + // Observer registration for parties interested in discovery events. |
| + virtual void AddObserver(NsdObserver* observer); |
| + virtual void RemoveObserver(NsdObserver* observer); |
| + |
| + // MDNS-related discovery functionality. |
| + virtual void RegisterMDnsListener(std::string serviceName); |
| + virtual void UnregisterMDnsListener(std::string serviceName); |
| + |
| + protected: |
| + ObserverList<NsdObserver> observers_; |
| +}; |
| + |
| +} // namespace extensions |
| + |
| +#endif // CHROME_BROWSER_EXTENSIONS_API_MDNS_NSD_REGISTRY_H_ |