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

Unified Diff: chrome/browser/extensions/api/mdns/nsd_registry.cc

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.cc
diff --git a/chrome/browser/extensions/api/mdns/nsd_registry.cc b/chrome/browser/extensions/api/mdns/nsd_registry.cc
new file mode 100644
index 0000000000000000000000000000000000000000..b14a29965f606be13566bc9a7928e8f6d8550399
--- /dev/null
+++ b/chrome/browser/extensions/api/mdns/nsd_registry.cc
@@ -0,0 +1,30 @@
+// 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.
+
+#include "chrome/browser/extensions/api/mdns/nsd_registry.h"
+
+namespace extensions {
+
+NsdRegistry::NsdRegistry(Observer* observer) /*: observer_(observer)*/ {
+}
+
+NsdRegistry::~NsdRegistry() {
+}
+
+MDnsService* NsdRegistry::mdns_service() {
+ if (!mdns_service_.get()) {
+ mdns_service_.reset(new MDnsService("", NULL));
+ }
+ return mdns_service_.get();
+}
+
+void NsdRegistry::RegisterMDnsListener(std::string service_name) {
+ mdns_service()->Start();
+}
+
+void NsdRegistry::UnregisterMDnsListener(std::string service_name) {
+ mdns_service()->Stop();
+}
+
+} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698