#include "chrome/browser/extensions/api/mdns/mdns_api.h"
#include <utility>
#include <vector>
#include "base/lazy_instance.h"
#include "base/strings/stringprintf.h"
#include "base/values.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/common/extensions/api/mdns.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/web_contents.h"
#include "extensions/browser/extension_function.h"
#include "extensions/browser/extension_host.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/common/extension_id.h"
#include "extensions/common/mojom/event_dispatcher.mojom.h"
namespace extensions {
mdns;
DnsSdRegistry;
MDnsAPI::MDnsAPI(content::BrowserContext* context)
: … { … }
MDnsAPI::~MDnsAPI() { … }
MDnsAPI* MDnsAPI::Get(content::BrowserContext* context) { … }
static base::LazyInstance<BrowserContextKeyedAPIFactory<MDnsAPI>>::
DestructorAtExit g_mdns_api_factory = …;
BrowserContextKeyedAPIFactory<MDnsAPI>* MDnsAPI::GetFactoryInstance() { … }
void MDnsAPI::SetDnsSdRegistryForTesting(DnsSdRegistry* dns_sd_registry) { … }
void MDnsAPI::ForceDiscovery() { … }
DnsSdRegistry* MDnsAPI::dns_sd_registry() { … }
void MDnsAPI::OnListenerAdded(const EventListenerInfo& details) { … }
void MDnsAPI::OnListenerRemoved(const EventListenerInfo& details) { … }
void MDnsAPI::UpdateMDnsListeners() { … }
void MDnsAPI::OnDnsSdEvent(const std::string& service_type,
const DnsSdRegistry::DnsSdServiceList& services) { … }
const extensions::EventListenerMap::ListenerList& MDnsAPI::GetEventListeners() { … }
bool MDnsAPI::IsMDnsAllowed(const ExtensionId& extension_id) const { … }
void MDnsAPI::GetValidOnServiceListListeners(
const std::string& service_type_filter,
std::set<ExtensionId>* extension_ids,
ServiceTypeCounts* service_type_counts) { … }
void MDnsAPI::WriteToConsole(const std::string& service_type,
blink::mojom::ConsoleMessageLevel level,
const std::string& message) { … }
ExtensionFunction::ResponseAction MdnsForceDiscoveryFunction::Run() { … }
}