mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02: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:
Notes:
github-actions[bot]
2025-02-21 12:55:13 +00:00
Author: https://github.com/Lubrsi Commit: https://github.com/LadybirdBrowser/ladybird/commit/cae0ab2139a Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3627 Reviewed-by: https://github.com/AtkinsSJ ✅
22
Libraries/LibWeb/HTML/SourceSnapshotParams.cpp
Normal file
22
Libraries/LibWeb/HTML/SourceSnapshotParams.cpp
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright (c) 2025, Luke Wilde <luke@ladybird.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibWeb/HTML/PolicyContainers.h>
|
||||
#include <LibWeb/HTML/Scripting/Environments.h>
|
||||
#include <LibWeb/HTML/SourceSnapshotParams.h>
|
||||
|
||||
namespace Web::HTML {
|
||||
|
||||
GC_DEFINE_ALLOCATOR(SourceSnapshotParams);
|
||||
|
||||
void SourceSnapshotParams::visit_edges(Cell::Visitor& visitor)
|
||||
{
|
||||
Base::visit_edges(visitor);
|
||||
visitor.visit(fetch_client);
|
||||
visitor.visit(source_policy_container);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user