#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-private-field"
#endif
#include "services/network/public/mojom/host_resolver.mojom-blink.h"
#include <math.h>
#include <stdint.h>
#include <utility>
#include "base/debug/alias.h"
#include "base/hash/md5_constexpr.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/task/thread_pool/thread_pool_instance.h"
#include "base/trace_event/trace_event.h"
#include "base/trace_event/typed_macros.h"
#include "mojo/public/cpp/bindings/features.h"
#include "mojo/public/cpp/bindings/lib/default_construct_tag_internal.h"
#include "mojo/public/cpp/bindings/lib/generated_code_util.h"
#include "mojo/public/cpp/bindings/lib/message_internal.h"
#include "mojo/public/cpp/bindings/lib/proxy_to_responder.h"
#include "mojo/public/cpp/bindings/lib/send_message_helper.h"
#include "mojo/public/cpp/bindings/lib/serialization_util.h"
#include "mojo/public/cpp/bindings/lib/unserialized_message_context.h"
#include "mojo/public/cpp/bindings/lib/validate_params.h"
#include "mojo/public/cpp/bindings/lib/validation_errors.h"
#include "mojo/public/cpp/bindings/mojo_buildflags.h"
#include "mojo/public/cpp/bindings/urgent_message_scope.h"
#include "mojo/public/interfaces/bindings/interface_control_messages.mojom.h"
#include "third_party/perfetto/include/perfetto/tracing/traced_value.h"
#include "services/network/public/mojom/host_resolver.mojom-params-data.h"
#include "services/network/public/mojom/host_resolver.mojom-shared-message-ids.h"
#include "services/network/public/mojom/host_resolver.mojom-blink-import-headers.h"
#include "services/network/public/mojom/host_resolver.mojom-blink-test-utils.h"
#include "mojo/public/cpp/bindings/lib/wtf_serialization.h"
namespace network::mojom::blink {
DnsOverHttpsServerConfig::DnsOverHttpsServerConfig()
: … { … }
DnsOverHttpsServerConfig::DnsOverHttpsServerConfig(
const WTF::String& server_template_in,
WTF::Vector<WTF::Vector<::net::IPAddress>> endpoints_in)
: … { … }
DnsOverHttpsServerConfig::~DnsOverHttpsServerConfig() = default;
void DnsOverHttpsServerConfig::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool DnsOverHttpsServerConfig::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
DnsOverHttpsConfig::DnsOverHttpsConfig()
: … { … }
DnsOverHttpsConfig::DnsOverHttpsConfig(
WTF::Vector<DnsOverHttpsServerConfigPtr> servers_in)
: … { … }
DnsOverHttpsConfig::~DnsOverHttpsConfig() = default;
void DnsOverHttpsConfig::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool DnsOverHttpsConfig::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
DnsConfigOverrides::DnsConfigOverrides()
: … { … }
DnsConfigOverrides::DnsConfigOverrides(
std::optional<WTF::Vector<::net::IPEndPoint>> nameservers_in,
std::optional<WTF::Vector<WTF::String>> search_in,
DnsConfigOverrides::Tristate append_to_multi_label_name_in,
int8_t ndots_in,
std::optional<::base::TimeDelta> fallback_period_in,
int32_t attempts_in,
DnsConfigOverrides::Tristate rotate_in,
DnsConfigOverrides::Tristate use_local_ipv6_in,
DnsOverHttpsConfigPtr dns_over_https_config_in,
OptionalSecureDnsMode secure_dns_mode_in,
DnsConfigOverrides::Tristate allow_dns_over_https_upgrade_in,
bool clear_hosts_in)
: … { … }
DnsConfigOverrides::~DnsConfigOverrides() = default;
void DnsConfigOverrides::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool DnsConfigOverrides::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
ResolveHostParameters::ResolveHostParameters()
: … { … }
ResolveHostParameters::ResolveHostParameters(
::net::DnsQueryType dns_query_type_in,
::net::RequestPriority initial_priority_in,
ResolveHostParameters::Source source_in,
ResolveHostParameters::CacheUsage cache_usage_in,
::mojo::PendingReceiver<ResolveHostHandle> control_handle_in,
bool include_canonical_name_in,
bool loopback_only_in,
bool is_speculative_in,
SecureDnsPolicy secure_dns_policy_in,
ResolveHostParameters::Purpose purpose_in)
: … { … }
ResolveHostParameters::~ResolveHostParameters() = default;
void ResolveHostParameters::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool ResolveHostParameters::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
HostResolverHost::HostResolverHost() : … { … }
HostResolverHost::~HostResolverHost() { … }
void HostResolverHost::set_scheme_host_port(
const ::url::SchemeHostPort& scheme_host_port) { … }
void HostResolverHost::set_host_port_pair(
const ::net::HostPortPair& host_port_pair) { … }
void HostResolverHost::DestroyActive() { … }
bool HostResolverHost::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
const char ResolveHostHandle::Name_[] = …;
ResolveHostHandle::IPCStableHashFunction ResolveHostHandle::MessageToMethodInfo_(mojo::Message& message) { … }
const char* ResolveHostHandle::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t ResolveHostHandle::Cancel_Sym::IPCStableHash() { … }
# endif
ResolveHostHandleProxy::ResolveHostHandleProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void ResolveHostHandleProxy::Cancel(
int32_t in_result) { … }
bool ResolveHostHandleStubDispatch::Accept(
ResolveHostHandle* impl,
mojo::Message* message) { … }
bool ResolveHostHandleStubDispatch::AcceptWithResponder(
ResolveHostHandle* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kResolveHostHandleValidationInfo[] = …;
bool ResolveHostHandleRequestValidator::Accept(mojo::Message* message) { … }
const char ResolveHostClient::Name_[] = …;
ResolveHostClient::IPCStableHashFunction ResolveHostClient::MessageToMethodInfo_(mojo::Message& message) { … }
const char* ResolveHostClient::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t ResolveHostClient::OnComplete_Sym::IPCStableHash() { … }
uint32_t ResolveHostClient::OnTextResults_Sym::IPCStableHash() { … }
uint32_t ResolveHostClient::OnHostnameResults_Sym::IPCStableHash() { … }
# endif
ResolveHostClientProxy::ResolveHostClientProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void ResolveHostClientProxy::OnComplete(
int32_t in_result, ::network::mojom::blink::ResolveErrorInfoPtr in_resolve_error_info, ::network::mojom::blink::AddressListPtr in_resolved_addresses, std::optional<WTF::Vector<::network::mojom::blink::HostResolverEndpointResultPtr>> in_endpoint_results_with_metadata) { … }
void ResolveHostClientProxy::OnTextResults(
const WTF::Vector<WTF::String>& in_text_results) { … }
void ResolveHostClientProxy::OnHostnameResults(
const WTF::Vector<::net::HostPortPair>& in_hosts) { … }
bool ResolveHostClientStubDispatch::Accept(
ResolveHostClient* impl,
mojo::Message* message) { … }
bool ResolveHostClientStubDispatch::AcceptWithResponder(
ResolveHostClient* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kResolveHostClientValidationInfo[] = …;
bool ResolveHostClientRequestValidator::Accept(mojo::Message* message) { … }
const char MdnsListenClient::Name_[] = …;
MdnsListenClient::IPCStableHashFunction MdnsListenClient::MessageToMethodInfo_(mojo::Message& message) { … }
const char* MdnsListenClient::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t MdnsListenClient::OnAddressResult_Sym::IPCStableHash() { … }
uint32_t MdnsListenClient::OnTextResult_Sym::IPCStableHash() { … }
uint32_t MdnsListenClient::OnHostnameResult_Sym::IPCStableHash() { … }
uint32_t MdnsListenClient::OnUnhandledResult_Sym::IPCStableHash() { … }
# endif
MdnsListenClientProxy::MdnsListenClientProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void MdnsListenClientProxy::OnAddressResult(
MdnsListenClient::UpdateType in_update_type, ::net::DnsQueryType in_query_type, const ::net::IPEndPoint& in_endpoint) { … }
void MdnsListenClientProxy::OnTextResult(
MdnsListenClient::UpdateType in_update_type, ::net::DnsQueryType in_query_type, const WTF::Vector<WTF::String>& in_text_records) { … }
void MdnsListenClientProxy::OnHostnameResult(
MdnsListenClient::UpdateType in_update_type, ::net::DnsQueryType in_query_type, const ::net::HostPortPair& in_host) { … }
void MdnsListenClientProxy::OnUnhandledResult(
MdnsListenClient::UpdateType in_update_type, ::net::DnsQueryType in_query_type) { … }
bool MdnsListenClientStubDispatch::Accept(
MdnsListenClient* impl,
mojo::Message* message) { … }
bool MdnsListenClientStubDispatch::AcceptWithResponder(
MdnsListenClient* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kMdnsListenClientValidationInfo[] = …;
bool MdnsListenClientRequestValidator::Accept(mojo::Message* message) { … }
const char HostResolver::Name_[] = …;
HostResolver::IPCStableHashFunction HostResolver::MessageToMethodInfo_(mojo::Message& message) { … }
const char* HostResolver::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t HostResolver::ResolveHost_Sym::IPCStableHash() { … }
uint32_t HostResolver::MdnsListen_Sym::IPCStableHash() { … }
# endif
class HostResolver_MdnsListen_ForwardToCallback
: public mojo::MessageReceiver { … };
HostResolverProxy::HostResolverProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void HostResolverProxy::ResolveHost(
HostResolverHostPtr in_host, ::network::mojom::blink::NetworkAnonymizationKeyPtr in_network_anonymization_key, ResolveHostParametersPtr in_optional_parameters, ::mojo::PendingRemote<ResolveHostClient> in_response_client) { … }
void HostResolverProxy::MdnsListen(
const ::net::HostPortPair& in_host, ::net::DnsQueryType in_query_type, ::mojo::PendingRemote<MdnsListenClient> in_response_client, MdnsListenCallback callback) { … }
class HostResolver_MdnsListen_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool HostResolver_MdnsListen_ForwardToCallback::Accept(
mojo::Message* message) { … }
void HostResolver_MdnsListen_ProxyToResponder::Run(
int32_t in_result) { … }
bool HostResolverStubDispatch::Accept(
HostResolver* impl,
mojo::Message* message) { … }
bool HostResolverStubDispatch::AcceptWithResponder(
HostResolver* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kHostResolverValidationInfo[] = …;
bool HostResolverRequestValidator::Accept(mojo::Message* message) { … }
bool HostResolverResponseValidator::Accept(mojo::Message* message) { … }
const char DnsConfigChangeManagerClient::Name_[] = …;
DnsConfigChangeManagerClient::IPCStableHashFunction DnsConfigChangeManagerClient::MessageToMethodInfo_(mojo::Message& message) { … }
const char* DnsConfigChangeManagerClient::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t DnsConfigChangeManagerClient::OnDnsConfigChanged_Sym::IPCStableHash() { … }
# endif
DnsConfigChangeManagerClientProxy::DnsConfigChangeManagerClientProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void DnsConfigChangeManagerClientProxy::OnDnsConfigChanged(
) { … }
bool DnsConfigChangeManagerClientStubDispatch::Accept(
DnsConfigChangeManagerClient* impl,
mojo::Message* message) { … }
bool DnsConfigChangeManagerClientStubDispatch::AcceptWithResponder(
DnsConfigChangeManagerClient* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kDnsConfigChangeManagerClientValidationInfo[] = …;
bool DnsConfigChangeManagerClientRequestValidator::Accept(mojo::Message* message) { … }
const char DnsConfigChangeManager::Name_[] = …;
DnsConfigChangeManager::IPCStableHashFunction DnsConfigChangeManager::MessageToMethodInfo_(mojo::Message& message) { … }
const char* DnsConfigChangeManager::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t DnsConfigChangeManager::RequestNotifications_Sym::IPCStableHash() { … }
# endif
DnsConfigChangeManagerProxy::DnsConfigChangeManagerProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void DnsConfigChangeManagerProxy::RequestNotifications(
::mojo::PendingRemote<DnsConfigChangeManagerClient> in_client) { … }
bool DnsConfigChangeManagerStubDispatch::Accept(
DnsConfigChangeManager* impl,
mojo::Message* message) { … }
bool DnsConfigChangeManagerStubDispatch::AcceptWithResponder(
DnsConfigChangeManager* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kDnsConfigChangeManagerValidationInfo[] = …;
bool DnsConfigChangeManagerRequestValidator::Accept(mojo::Message* message) { … }
}
namespace mojo {
bool StructTraits<::network::mojom::blink::DnsOverHttpsServerConfig::DataView, ::network::mojom::blink::DnsOverHttpsServerConfigPtr>::Read(
::network::mojom::blink::DnsOverHttpsServerConfig::DataView input,
::network::mojom::blink::DnsOverHttpsServerConfigPtr* output) { … }
bool StructTraits<::network::mojom::blink::DnsOverHttpsConfig::DataView, ::network::mojom::blink::DnsOverHttpsConfigPtr>::Read(
::network::mojom::blink::DnsOverHttpsConfig::DataView input,
::network::mojom::blink::DnsOverHttpsConfigPtr* output) { … }
bool StructTraits<::network::mojom::blink::DnsConfigOverrides::DataView, ::network::mojom::blink::DnsConfigOverridesPtr>::Read(
::network::mojom::blink::DnsConfigOverrides::DataView input,
::network::mojom::blink::DnsConfigOverridesPtr* output) { … }
bool StructTraits<::network::mojom::blink::ResolveHostParameters::DataView, ::network::mojom::blink::ResolveHostParametersPtr>::Read(
::network::mojom::blink::ResolveHostParameters::DataView input,
::network::mojom::blink::ResolveHostParametersPtr* output) { … }
bool UnionTraits<::network::mojom::blink::HostResolverHost::DataView, ::network::mojom::blink::HostResolverHostPtr>::Read(
::network::mojom::blink::HostResolverHost::DataView input,
::network::mojom::blink::HostResolverHostPtr* output) { … }
}
namespace network::mojom::blink {
void ResolveHostHandleInterceptorForTesting::Cancel(int32_t result) { … }
ResolveHostHandleAsyncWaiter::ResolveHostHandleAsyncWaiter(
ResolveHostHandle* proxy) : … { … }
ResolveHostHandleAsyncWaiter::~ResolveHostHandleAsyncWaiter() = default;
void ResolveHostClientInterceptorForTesting::OnComplete(int32_t result, ::network::mojom::blink::ResolveErrorInfoPtr resolve_error_info, ::network::mojom::blink::AddressListPtr resolved_addresses, std::optional<WTF::Vector<::network::mojom::blink::HostResolverEndpointResultPtr>> endpoint_results_with_metadata) { … }
void ResolveHostClientInterceptorForTesting::OnTextResults(const WTF::Vector<WTF::String>& text_results) { … }
void ResolveHostClientInterceptorForTesting::OnHostnameResults(const WTF::Vector<::net::HostPortPair>& hosts) { … }
ResolveHostClientAsyncWaiter::ResolveHostClientAsyncWaiter(
ResolveHostClient* proxy) : … { … }
ResolveHostClientAsyncWaiter::~ResolveHostClientAsyncWaiter() = default;
void MdnsListenClientInterceptorForTesting::OnAddressResult(MdnsListenClient::UpdateType update_type, ::net::DnsQueryType query_type, const ::net::IPEndPoint& endpoint) { … }
void MdnsListenClientInterceptorForTesting::OnTextResult(MdnsListenClient::UpdateType update_type, ::net::DnsQueryType query_type, const WTF::Vector<WTF::String>& text_records) { … }
void MdnsListenClientInterceptorForTesting::OnHostnameResult(MdnsListenClient::UpdateType update_type, ::net::DnsQueryType query_type, const ::net::HostPortPair& host) { … }
void MdnsListenClientInterceptorForTesting::OnUnhandledResult(MdnsListenClient::UpdateType update_type, ::net::DnsQueryType query_type) { … }
MdnsListenClientAsyncWaiter::MdnsListenClientAsyncWaiter(
MdnsListenClient* proxy) : … { … }
MdnsListenClientAsyncWaiter::~MdnsListenClientAsyncWaiter() = default;
void HostResolverInterceptorForTesting::ResolveHost(HostResolverHostPtr host, ::network::mojom::blink::NetworkAnonymizationKeyPtr network_anonymization_key, ResolveHostParametersPtr optional_parameters, ::mojo::PendingRemote<ResolveHostClient> response_client) { … }
void HostResolverInterceptorForTesting::MdnsListen(const ::net::HostPortPair& host, ::net::DnsQueryType query_type, ::mojo::PendingRemote<MdnsListenClient> response_client, MdnsListenCallback callback) { … }
HostResolverAsyncWaiter::HostResolverAsyncWaiter(
HostResolver* proxy) : … { … }
HostResolverAsyncWaiter::~HostResolverAsyncWaiter() = default;
void HostResolverAsyncWaiter::MdnsListen(
const ::net::HostPortPair& host, ::net::DnsQueryType query_type, ::mojo::PendingRemote<MdnsListenClient> response_client, int32_t* out_result) { … }
int32_t HostResolverAsyncWaiter::MdnsListen(
const ::net::HostPortPair& host, ::net::DnsQueryType query_type, ::mojo::PendingRemote<MdnsListenClient> response_client) { … }
void DnsConfigChangeManagerClientInterceptorForTesting::OnDnsConfigChanged() { … }
DnsConfigChangeManagerClientAsyncWaiter::DnsConfigChangeManagerClientAsyncWaiter(
DnsConfigChangeManagerClient* proxy) : … { … }
DnsConfigChangeManagerClientAsyncWaiter::~DnsConfigChangeManagerClientAsyncWaiter() = default;
void DnsConfigChangeManagerInterceptorForTesting::RequestNotifications(::mojo::PendingRemote<DnsConfigChangeManagerClient> client) { … }
DnsConfigChangeManagerAsyncWaiter::DnsConfigChangeManagerAsyncWaiter(
DnsConfigChangeManager* proxy) : … { … }
DnsConfigChangeManagerAsyncWaiter::~DnsConfigChangeManagerAsyncWaiter() = default;
}
#if defined(__clang__)
#pragma clang diagnostic pop
#endif