#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "net/dns/dns_hosts.h"
#include <string>
#include <string_view>
#include <utility>
#include "base/check.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/metrics/histogram_functions.h"
#include "base/strings/string_util.h"
#include "base/trace_event/memory_usage_estimator.h"
#include "build/build_config.h"
#include "net/base/cronet_buildflags.h"
#include "net/base/url_util.h"
#include "net/dns/dns_util.h"
#include "url/url_canon.h"
namespace net {
namespace {
class HostsParser { … };
void ParseHostsWithCommaMode(const std::string& contents,
DnsHosts* dns_hosts,
ParseHostsCommaMode comma_mode) { … }
}
void ParseHostsWithCommaModeForTesting(const std::string& contents,
DnsHosts* dns_hosts,
ParseHostsCommaMode comma_mode) { … }
void ParseHosts(const std::string& contents, DnsHosts* dns_hosts) { … }
DnsHostsParser::~DnsHostsParser() = default;
DnsHostsFileParser::DnsHostsFileParser(base::FilePath hosts_file_path)
: … { … }
DnsHostsFileParser::~DnsHostsFileParser() = default;
bool DnsHostsFileParser::ParseHosts(DnsHosts* dns_hosts) const { … }
}