#include "third_party/blink/renderer/core/permissions_policy/document_policy_parser.h"
#include "net/http/structured_headers.h"
#include "third_party/blink/public/mojom/permissions_policy/policy_value.mojom-blink.h"
namespace blink {
namespace {
constexpr const char* kReportTo = …;
constexpr const char* kNone = …;
const char* PolicyValueTypeToString(mojom::blink::PolicyValueType type) { … }
std::optional<PolicyValue> ItemToPolicyValue(
const net::structured_headers::Item& item,
mojom::blink::PolicyValueType type) { … }
std::optional<std::string> ItemToString(
const net::structured_headers::Item& item) { … }
struct ParsedFeature { … };
std::optional<ParsedFeature> ParseFeature(
const net::structured_headers::DictionaryMember& directive,
const DocumentPolicyNameFeatureMap& name_feature_map,
const DocumentPolicyFeatureInfoMap& feature_info_map,
PolicyParserMessageBuffer& logger) { … }
void ApplyDefaultEndpoint(DocumentPolicy::ParsedDocumentPolicy& parsed_policy,
const std::string& default_endpoint) { … }
}
std::optional<DocumentPolicy::ParsedDocumentPolicy> DocumentPolicyParser::Parse(
const String& policy_string,
PolicyParserMessageBuffer& logger) { … }
std::optional<DocumentPolicy::ParsedDocumentPolicy>
DocumentPolicyParser::ParseInternal(
const String& policy_string,
const DocumentPolicyNameFeatureMap& name_feature_map,
const DocumentPolicyFeatureInfoMap& feature_info_map,
const DocumentPolicyFeatureSet& available_features,
PolicyParserMessageBuffer& logger) { … }
}