EmbedderPolicy.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * Copyright (c) 2024, Jamie Mansfield <jmansfield@cadixdev.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <AK/Optional.h>
  8. #include <AK/String.h>
  9. #include <AK/StringView.h>
  10. namespace Web::HTML {
  11. // https://html.spec.whatwg.org/multipage/browsers.html#embedder-policy-value
  12. enum class EmbedderPolicyValue {
  13. UnsafeNone,
  14. RequireCorp,
  15. Credentialless,
  16. };
  17. StringView embedder_policy_value_to_string(EmbedderPolicyValue);
  18. Optional<EmbedderPolicyValue> embedder_policy_value_from_string(StringView);
  19. // https://html.spec.whatwg.org/multipage/browsers.html#embedder-policy
  20. struct EmbedderPolicy {
  21. // https://html.spec.whatwg.org/multipage/browsers.html#embedder-policy-value-2
  22. // A value, which is an embedder policy value, initially "unsafe-none".
  23. EmbedderPolicyValue value { EmbedderPolicyValue::UnsafeNone };
  24. // https://html.spec.whatwg.org/multipage/browsers.html#embedder-policy-reporting-endpoint
  25. // A reporting endpoint string, initially the empty string.
  26. String reporting_endpoint;
  27. // https://html.spec.whatwg.org/multipage/browsers.html#embedder-policy-report-only-value
  28. // A report only value, which is an embedder policy value, initially "unsafe-none".
  29. EmbedderPolicyValue report_only_value { EmbedderPolicyValue::UnsafeNone };
  30. // https://html.spec.whatwg.org/multipage/browsers.html#embedder-policy-report-only-reporting-endpoint
  31. // A report only reporting endpoint string, initially the empty string.
  32. String report_only_reporting_endpoint;
  33. };
  34. }