#include "third_party/blink/public/common/permissions_policy/document_policy.h"
#include "base/memory/ptr_util.h"
#include "base/no_destructor.h"
#include "net/http/structured_headers.h"
#include "third_party/blink/public/mojom/permissions_policy/permissions_policy_feature.mojom.h"
namespace blink {
std::unique_ptr<DocumentPolicy> DocumentPolicy::CreateWithHeaderPolicy(
const ParsedDocumentPolicy& header_policy) { … }
std::unique_ptr<DocumentPolicy> DocumentPolicy::CopyStateFrom(
const DocumentPolicy* source) { … }
namespace {
net::structured_headers::Item PolicyValueToItem(const PolicyValue& value) { … }
}
std::optional<std::string> DocumentPolicy::Serialize(
const DocumentPolicyFeatureState& policy) { … }
std::optional<std::string> DocumentPolicy::SerializeInternal(
const DocumentPolicyFeatureState& policy,
const DocumentPolicyFeatureInfoMap& feature_info_map) { … }
DocumentPolicyFeatureState DocumentPolicy::MergeFeatureState(
const DocumentPolicyFeatureState& base_policy,
const DocumentPolicyFeatureState& override_policy) { … }
bool DocumentPolicy::IsFeatureEnabled(
mojom::DocumentPolicyFeature feature) const { … }
bool DocumentPolicy::IsFeatureEnabled(
mojom::DocumentPolicyFeature feature,
const PolicyValue& threshold_value) const { … }
PolicyValue DocumentPolicy::GetFeatureValue(
mojom::DocumentPolicyFeature feature) const { … }
const std::optional<std::string> DocumentPolicy::GetFeatureEndpoint(
mojom::DocumentPolicyFeature feature) const { … }
void DocumentPolicy::UpdateFeatureState(
const DocumentPolicyFeatureState& feature_state) { … }
DocumentPolicy::DocumentPolicy(const DocumentPolicyFeatureState& header_policy,
const FeatureEndpointMap& endpoint_map,
const DocumentPolicyFeatureState& defaults)
: … { … }
std::unique_ptr<DocumentPolicy> DocumentPolicy::CreateWithHeaderPolicy(
const DocumentPolicyFeatureState& header_policy,
const FeatureEndpointMap& endpoint_map,
const DocumentPolicyFeatureState& defaults) { … }
bool DocumentPolicy::IsPolicyCompatible(
const DocumentPolicyFeatureState& required_policy,
const DocumentPolicyFeatureState& incoming_policy) { … }
}