mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-26 04:07:51 +00:00
LibWeb: Make a bunch of CSP classes not realm associated
These are not associated with a javascript realm, so to avoid confusion about which realm these need to be created in, make all of these objects a GC::Cell, and deal with the fallout.
This commit is contained in:
parent
04fde1c550
commit
8a3c66d8a6
Notes:
github-actions[bot]
2025-04-28 10:42:23 +00:00
Author: https://github.com/shannonbooth
Commit: 8a3c66d8a6
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4484
20 changed files with 91 additions and 92 deletions
|
@ -20,8 +20,8 @@ namespace Web::ContentSecurityPolicy {
|
|||
// https://w3c.github.io/webappsec-csp/#content-security-policy-object
|
||||
// A policy defines allowed and restricted behaviors, and may be applied to a Document, WorkerGlobalScope,
|
||||
// or WorkletGlobalScope.
|
||||
class Policy final : public JS::Cell {
|
||||
GC_CELL(Policy, JS::Cell);
|
||||
class Policy final : public GC::Cell {
|
||||
GC_CELL(Policy, GC::Cell);
|
||||
GC_DECLARE_ALLOCATOR(Policy);
|
||||
|
||||
public:
|
||||
|
@ -38,9 +38,9 @@ public:
|
|||
|
||||
~Policy() = default;
|
||||
|
||||
[[nodiscard]] static GC::Ref<Policy> parse_a_serialized_csp(JS::Realm&, Variant<ByteBuffer, String> serialized, Source source, Disposition disposition);
|
||||
[[nodiscard]] static GC::Ref<PolicyList> parse_a_responses_content_security_policies(JS::Realm&, GC::Ref<Fetch::Infrastructure::Response const> response);
|
||||
[[nodiscard]] static GC::Ref<Policy> create_from_serialized_policy(JS::Realm&, SerializedPolicy const&);
|
||||
[[nodiscard]] static GC::Ref<Policy> parse_a_serialized_csp(GC::Heap&, Variant<ByteBuffer, String> serialized, Source source, Disposition disposition);
|
||||
[[nodiscard]] static GC::Ref<PolicyList> parse_a_responses_content_security_policies(GC::Heap&, GC::Ref<Fetch::Infrastructure::Response const> response);
|
||||
[[nodiscard]] static GC::Ref<Policy> create_from_serialized_policy(GC::Heap&, SerializedPolicy const&);
|
||||
|
||||
[[nodiscard]] Vector<GC::Ref<Directives::Directive>> const& directives() const { return m_directives; }
|
||||
[[nodiscard]] Disposition disposition() const { return m_disposition; }
|
||||
|
@ -51,7 +51,7 @@ public:
|
|||
[[nodiscard]] bool contains_directive_with_name(StringView name) const;
|
||||
[[nodiscard]] GC::Ptr<Directives::Directive> get_directive_by_name(StringView) const;
|
||||
|
||||
[[nodiscard]] GC::Ref<Policy> clone(JS::Realm&) const;
|
||||
[[nodiscard]] GC::Ref<Policy> clone(GC::Heap&) const;
|
||||
[[nodiscard]] SerializedPolicy serialize() const;
|
||||
|
||||
protected:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue