mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-07 00:29:15 +00:00
LibWeb: Make PolicyContainer GC allocated
This is required to store Content Security Policies, as their Directives are implemented as subclasses with overridden virtual functions. Thus, they cannot be stored as generic Directive classes, as it'll lose the ability to call overridden functions when they are copied.
This commit is contained in:
parent
2e27ffab6c
commit
cae0ab2139
Notes:
github-actions[bot]
2025-02-21 12:55:13 +00:00
Author: https://github.com/Lubrsi
Commit: cae0ab2139
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3627
Reviewed-by: https://github.com/AtkinsSJ ✅
43 changed files with 381 additions and 130 deletions
|
@ -40,8 +40,8 @@ public:
|
|||
[[nodiscard]] GC::Ptr<DOM::Document> document() const { return m_document; }
|
||||
void set_document(GC::Ptr<DOM::Document> document) { m_document = document; }
|
||||
|
||||
[[nodiscard]] Variant<PolicyContainer, Client> history_policy_container() const { return m_history_policy_container; }
|
||||
void set_history_policy_container(Variant<PolicyContainer, Client> history_policy_container) { m_history_policy_container = move(history_policy_container); }
|
||||
[[nodiscard]] Variant<GC::Ref<PolicyContainer>, Client> history_policy_container() const { return m_history_policy_container; }
|
||||
void set_history_policy_container(Variant<GC::Ref<PolicyContainer>, Client> history_policy_container) { m_history_policy_container = move(history_policy_container); }
|
||||
|
||||
[[nodiscard]] Fetch::Infrastructure::Request::ReferrerType request_referrer() const { return m_request_referrer; }
|
||||
void set_request_referrer(Fetch::Infrastructure::Request::ReferrerType request_referrer) { m_request_referrer = move(request_referrer); }
|
||||
|
@ -82,7 +82,7 @@ private:
|
|||
GC::Ptr<DOM::Document> m_document;
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/browsing-the-web.html#document-state-history-policy-container
|
||||
Variant<PolicyContainer, Client> m_history_policy_container { Client::Tag };
|
||||
Variant<GC::Ref<PolicyContainer>, Client> m_history_policy_container { Client::Tag };
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/browsing-the-web.html#document-state-request-referrer
|
||||
Fetch::Infrastructure::Request::ReferrerType m_request_referrer { Fetch::Infrastructure::Request::Referrer::Client };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue