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

Side by Side Diff: chrome/browser/extensions/api/mdns/nsd_registry.h

Issue 22870011: chrome.mdns API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add tests Created 7 years, 3 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 | Annotate | Revision Log
OLDNEW
(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
16 // services discovered on the local network.
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698