#include "services/network/public/cpp/link_header_parser.h"
#include <algorithm>
#include <string>
#include <unordered_map>
#include "base/strings/string_util.h"
#include "components/link_header_util/link_header_util.h"
#include "net/base/mime_util.h"
#include "net/http/http_response_headers.h"
namespace network {
namespace {
bool IsValidMimeType(const std::string& type_string) { … }
std::optional<mojom::LinkRelAttribute> ParseRelAttribute(
const std::optional<std::string>& attr) { … }
std::optional<mojom::LinkAsAttribute> ParseAsAttribute(
const std::optional<std::string>& attr) { … }
std::optional<mojom::CrossOriginAttribute> ParseCrossOriginAttribute(
const std::optional<std::string>& attr) { … }
std::optional<mojom::FetchPriorityAttribute> ParseFetchPriorityAttribute(
const std::optional<std::string>& attr) { … }
bool ParseAttributes(
const std::unordered_map<std::string, std::optional<std::string>>& attrs,
mojom::LinkHeaderPtr& parsed) { … }
}
std::vector<mojom::LinkHeaderPtr> ParseLinkHeaders(
const net::HttpResponseHeaders& headers,
const GURL& base_url) { … }
}