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

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

Issue 1040773002: Limit number of service instances passed to onServiceList listeners. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add testing:: prefix before MakeMatcher to fix windows build Created 5 years, 8 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 | « no previous file | chrome/browser/extensions/api/mdns/mdns_api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/mdns/mdns_api.h
diff --git a/chrome/browser/extensions/api/mdns/mdns_api.h b/chrome/browser/extensions/api/mdns/mdns_api.h
index f232d3b07b95432a04137b46d5e01da57ec901cf..95e84285aa222321747e16536e46be1ecf933df2 100644
--- a/chrome/browser/extensions/api/mdns/mdns_api.h
+++ b/chrome/browser/extensions/api/mdns/mdns_api.h
@@ -13,6 +13,7 @@
#include "chrome/browser/extensions/api/mdns/dns_sd_registry.h"
#include "extensions/browser/browser_context_keyed_api_factory.h"
#include "extensions/browser/event_router.h"
+#include "extensions/browser/extension_function.h"
namespace content {
class BrowserContext;
@@ -67,6 +68,20 @@ class MDnsAPI : public BrowserContextKeyedAPI,
// Update the current list of service types and update the registry.
void UpdateMDnsListeners(const EventListenerInfo& details);
+ // Write a message to the consoles of extensions listening to a given service
+ // type.
+ void WriteToConsole(const std::string& service_type,
+ content::ConsoleMessageLevel level,
+ const std::string& message);
+
+ // Finds all all the valid listeners of the mdns.onServiceList event and
+ // filters them by service type if |service_type_filter| is non-empty. The
+ // extension ids and matched service types are output to |extension_ids| and
+ // |service_types|, respectively, if the supplied pointers is non-null.
+ void GetValidOnServiceListListeners(const std::string& service_type_filter,
+ std::set<std::string>* extension_ids,
+ std::set<std::string>* service_types);
+
// Ensure methods are only called on UI thread.
base::ThreadChecker thread_checker_;
content::BrowserContext* const browser_context_;
« no previous file with comments | « no previous file | chrome/browser/extensions/api/mdns/mdns_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698