// Copyright 2021 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 NET_DNS_HOST_RESOLVER_RESULTS_H_ #define NET_DNS_HOST_RESOLVER_RESULTS_H_ #include #include #include #include "net/base/connection_endpoint_metadata.h" #include "net/base/ip_endpoint.h" #include "net/base/net_export.h" namespace net { // Host-resolution-result representation of a single endpoint and the // information necessary to attempt a connection to that endpoint. struct NET_EXPORT_PRIVATE HostResolverEndpointResult { HostResolverEndpointResult(); ~HostResolverEndpointResult(); HostResolverEndpointResult(const HostResolverEndpointResult&); HostResolverEndpointResult& operator=(const HostResolverEndpointResult&) = default; HostResolverEndpointResult(HostResolverEndpointResult&&); HostResolverEndpointResult& operator=(HostResolverEndpointResult&&) = default; bool operator==(const HostResolverEndpointResult& other) const { return std::tie(ip_endpoints, metadata) == std::tie(other.ip_endpoints, other.metadata); } bool operator!=(const HostResolverEndpointResult& other) const { return !(*this == other); } // IP endpoints at which to connect to the service. std::vector ip_endpoints; // Additional metadata for creating connections to the endpoint. Typically // sourced from DNS HTTPS records. ConnectionEndpointMetadata metadata; }; } // namespace net #endif // NET_DNS_HOST_RESOLVER_RESULTS_H_