#include "services/network/restricted_udp_socket.h"
#include "base/functional/bind.h"
#include "net/base/ip_address.h"
#include "net/base/ip_endpoint.h"
#include "net/base/net_errors.h"
#include "net/base/network_anonymization_key.h"
#include "services/network/public/cpp/simple_host_resolver.h"
#include "services/network/public/mojom/host_resolver.mojom.h"
#include "services/network/udp_socket.h"
namespace network {
RestrictedUDPSocket::RestrictedUDPSocket(
std::unique_ptr<UDPSocket> udp_socket,
net::MutableNetworkTrafficAnnotationTag traffic_annotation,
std::unique_ptr<SimpleHostResolver> resolver)
: … { … }
RestrictedUDPSocket::~RestrictedUDPSocket() = default;
void RestrictedUDPSocket::ReceiveMore(uint32_t num_additional_datagrams) { … }
void RestrictedUDPSocket::Send(base::span<const uint8_t> data,
SendCallback callback) { … }
void RestrictedUDPSocket::SendTo(base::span<const uint8_t> data,
const net::HostPortPair& dest_addr,
net::DnsQueryType dns_query_type,
SendToCallback callback) { … }
#if BUILDFLAG(IS_CHROMEOS)
void RestrictedUDPSocket::AttachConnectionTracker(
mojo::PendingRemote<mojom::SocketConnectionTracker> connection_tracker) {
connection_tracker_ = std::move(connection_tracker);
}
#endif
void RestrictedUDPSocket::OnResolveCompleteForSendTo(
std::vector<uint8_t> data,
SendToCallback callback,
int result,
const net::ResolveErrorInfo&,
const std::optional<net::AddressList>& resolved_addresses,
const std::optional<net::HostResolverEndpointResults>&) { … }
}