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

Unified 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: address comments Created 7 years, 4 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
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..8aacdb496a063e887d5ab45a64b66214407c0c5e
--- /dev/null
+++ b/chrome/browser/extensions/api/mdns/nsd_registry.h
@@ -0,0 +1,48 @@
+// 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 "chrome/browser/extensions/api/mdns/mdns_service.h"
+
+namespace extensions {
+
+// Network Service Discovery registry class for keeping track of local network
+// services discovered on the local network.
+class NsdRegistry {
+ public:
+ // TODO:
+ typedef std::vector<std::string> NsdDeviceList;
+
+ class Observer {
+ public:
+ // virtual void OnNsdEvent(const NsdDeviceList& devices) = 0;
+ virtual void OnMDnsEvent(const std::string& service_type,
+ const NsdDeviceList& devices) = 0;
+
+ protected:
+ virtual ~Observer() {}
+ };
+
+ MDnsService *mdns_service();
+
+ explicit NsdRegistry(Observer* observer);
+ ~NsdRegistry();
+
+ void RegisterMDnsListener(std::string serviceName);
+ void UnregisterMDnsListener(std::string serviceName);
+
+ protected:
+
+ private:
+ scoped_ptr<MDnsService> mdns_service_;
+};
+
+} // namespace extensions
+
+#endif // CHROME_BROWSER_EXTENSIONS_API_MDNS_NSD_REGISTRY_H_

Powered by Google App Engine
This is Rietveld 408576698