#include "net/dns/public/dns_over_https_config.h"
#include <iterator>
#include <optional>
#include <string>
#include <string_view>
#include <vector>
#include "base/json/json_reader.h"
#include "base/json/json_writer.h"
#include "base/ranges/algorithm.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/values.h"
#include "net/dns/public/dns_over_https_server_config.h"
#include "net/dns/public/util.h"
namespace net {
namespace {
std::vector<std::string> SplitGroup(std::string_view group) { … }
std::vector<std::optional<DnsOverHttpsServerConfig>> ParseTemplates(
std::vector<std::string> templates) { … }
constexpr std::string_view kJsonKeyServers("servers");
std::optional<DnsOverHttpsConfig> FromValue(base::Value::Dict value) { … }
std::optional<DnsOverHttpsConfig> FromJson(std::string_view json) { … }
}
DnsOverHttpsConfig::DnsOverHttpsConfig() = default;
DnsOverHttpsConfig::~DnsOverHttpsConfig() = default;
DnsOverHttpsConfig::DnsOverHttpsConfig(const DnsOverHttpsConfig& other) =
default;
DnsOverHttpsConfig& DnsOverHttpsConfig::operator=(
const DnsOverHttpsConfig& other) = default;
DnsOverHttpsConfig::DnsOverHttpsConfig(DnsOverHttpsConfig&& other) = default;
DnsOverHttpsConfig& DnsOverHttpsConfig::operator=(DnsOverHttpsConfig&& other) =
default;
DnsOverHttpsConfig::DnsOverHttpsConfig(
std::vector<DnsOverHttpsServerConfig> servers)
: … { … }
std::optional<DnsOverHttpsConfig> DnsOverHttpsConfig::FromTemplates(
std::vector<std::string> server_templates) { … }
std::optional<DnsOverHttpsConfig> DnsOverHttpsConfig::FromTemplatesForTesting(
std::vector<std::string> server_templates) { … }
std::optional<DnsOverHttpsConfig> DnsOverHttpsConfig::FromString(
std::string_view doh_config) { … }
DnsOverHttpsConfig DnsOverHttpsConfig::FromStringLax(
std::string_view doh_config) { … }
bool DnsOverHttpsConfig::operator==(const DnsOverHttpsConfig& other) const { … }
std::string DnsOverHttpsConfig::ToString() const { … }
base::Value::Dict DnsOverHttpsConfig::ToValue() const { … }
}