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

Unified Diff: chrome/browser/extensions/api/dial/mdns_service.h

Issue 22870011: chrome.mdns API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/dial/mdns_service.h
diff --git a/chrome/browser/extensions/api/dial/mdns_service.h b/chrome/browser/extensions/api/dial/mdns_service.h
new file mode 100644
index 0000000000000000000000000000000000000000..60e186b73318c4722efd1ffaf183acbd2d0ae1a1
--- /dev/null
+++ b/chrome/browser/extensions/api/dial/mdns_service.h
@@ -0,0 +1,37 @@
+// 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_DIAL_MDNS_SERVICE_H_
+#define CHROME_BROWSER_EXTENSIONS_API_DIAL_MDNS_SERVICE_H_
+
+#include "chrome/browser/local_discovery/service_discovery_host_client.h"
+#include "chrome/common/local_discovery/service_discovery_client.h"
+
+namespace extensions {
+
+// Service for managing the mDNS device lister.
+class MDNSService {
mark a. foltz 2013/08/19 18:25:26 This is a bit simpler. Did you see an advantage t
+ public:
+ // TODO(justinlin): Should be singleton.
mark a. foltz 2013/08/19 18:25:26 Singleton per service_type? Agreed, but seems like
+ explicit MDNSService(std::string service_type);
+ ~MDNSService();
+
+ bool Start();
+ void Stop();
+ void Discover(bool force_update);
+
+ private:
+ void OnServiceUpdated(
+ local_discovery::ServiceWatcher::UpdateType update,
+ const std::string& service_name);
+
+ const std::string service_type_;
+ local_discovery::ServiceDiscoveryClient* service_discovery_client_;
+ scoped_ptr<local_discovery::ServiceWatcher> service_watcher_;
+ bool started_;
+};
+
+} // namespace extensions
+
+#endif // CHROME_BROWSER_EXTENSIONS_API_DIAL_MDNS_SERVICE_H_

Powered by Google App Engine
This is Rietveld 408576698