chromium/third_party/blink/renderer/core/permissions_policy/document_policy_parser.cc

// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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) {}

// Apply |default_endpoint| to given |parsed_policy|.
void ApplyDefaultEndpoint(DocumentPolicy::ParsedDocumentPolicy& parsed_policy,
                          const std::string& default_endpoint) {}

}  // namespace

// static
std::optional<DocumentPolicy::ParsedDocumentPolicy> DocumentPolicyParser::Parse(
    const String& policy_string,
    PolicyParserMessageBuffer& logger) {}

// static
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) {}

}  // namespace blink