mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-06 16:19:23 +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
|
@ -69,8 +69,8 @@ public:
|
|||
[[nodiscard]] ScrollRestorationMode scroll_restoration_mode() const { return m_scroll_restoration_mode; }
|
||||
void set_scroll_restoration_mode(ScrollRestorationMode scroll_restoration_mode) { m_scroll_restoration_mode = scroll_restoration_mode; }
|
||||
|
||||
[[nodiscard]] Optional<PolicyContainer> const& policy_container() const { return m_policy_container; }
|
||||
void set_policy_container(Optional<PolicyContainer> policy_container) { m_policy_container = move(policy_container); }
|
||||
[[nodiscard]] GC::Ptr<PolicyContainer> policy_container() const { return m_policy_container; }
|
||||
void set_policy_container(GC::Ptr<PolicyContainer> policy_container) { m_policy_container = policy_container; }
|
||||
|
||||
[[nodiscard]] Optional<ByteString> const& browsing_context_name() const { return m_browsing_context_name; }
|
||||
void set_browsing_context_name(Optional<ByteString> browsing_context_name) { m_browsing_context_name = move(browsing_context_name); }
|
||||
|
@ -111,7 +111,7 @@ private:
|
|||
ScrollRestorationMode m_scroll_restoration_mode { ScrollRestorationMode::Auto };
|
||||
|
||||
// policy container, a policy container or null
|
||||
Optional<PolicyContainer> m_policy_container;
|
||||
GC::Ptr<PolicyContainer> m_policy_container;
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/browsing-the-web.html#she-scroll-position
|
||||
// FIXME: scroll position data, which is scroll position data for the document's restorable scrollable regions
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue