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

Unified Diff: chrome/browser/extensions/api/mdns/dns_sd_registry.h

Issue 23437015: Initial chrome.mdns API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Disable test for WinDbg 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/api/mdns/OWNERS ('k') | chrome/browser/extensions/api/mdns/dns_sd_registry.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/mdns/dns_sd_registry.h
diff --git a/chrome/browser/extensions/api/mdns/dns_sd_registry.h b/chrome/browser/extensions/api/mdns/dns_sd_registry.h
new file mode 100644
index 0000000000000000000000000000000000000000..ed7d2a746a10b9d648de2f5ba586023f4973b001
--- /dev/null
+++ b/chrome/browser/extensions/api/mdns/dns_sd_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_DNS_SD_REGISTRY_H_
+#define CHROME_BROWSER_EXTENSIONS_API_MDNS_DNS_SD_REGISTRY_H_
+
+#include <string>
+#include <vector>
+
+#include "base/observer_list.h"
+
+namespace extensions {
+
+// Network Service Discovery registry class for keeping track of discovered
+// network services.
+class DnsSdRegistry {
+ public:
+ typedef std::vector<std::string> DnsSdServiceList;
+
+ class DnsSdObserver {
+ public:
+ virtual void OnDnsSdEvent(const std::string& service_type,
+ const DnsSdServiceList& services) = 0;
+
+ protected:
+ virtual ~DnsSdObserver() {}
+ };
+
+ explicit DnsSdRegistry();
+ virtual ~DnsSdRegistry();
+
+ // Observer registration for parties interested in discovery events.
+ virtual void AddObserver(DnsSdObserver* observer);
+ virtual void RemoveObserver(DnsSdObserver* observer);
+
+ // DNS-SD-related discovery functionality.
+ virtual void RegisterDnsSdListener(std::string service_type);
+ virtual void UnregisterDnsSdListener(std::string service_type);
+
+ protected:
+ ObserverList<DnsSdObserver> observers_;
+};
+
+} // namespace extensions
+
+#endif // CHROME_BROWSER_EXTENSIONS_API_MDNS_DNS_SD_REGISTRY_H_
« no previous file with comments | « chrome/browser/extensions/api/mdns/OWNERS ('k') | chrome/browser/extensions/api/mdns/dns_sd_registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698