123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- // 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 <string>
- #include <tuple>
- #include <vector>
- #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<net::IPEndPoint> 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_
|