mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-19 15:32:31 +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
|
@ -173,9 +173,9 @@ GC::Ref<CSS::FontFaceSet> WorkerGlobalScope::fonts()
|
|||
|
||||
GC::Ref<PolicyContainer> WorkerGlobalScope::policy_container() const
|
||||
{
|
||||
auto& realm = this->realm();
|
||||
auto& heap = this->heap();
|
||||
if (!m_policy_container) {
|
||||
m_policy_container = realm.create<PolicyContainer>(realm);
|
||||
m_policy_container = heap.allocate<PolicyContainer>(heap);
|
||||
}
|
||||
return *m_policy_container;
|
||||
}
|
||||
|
@ -195,7 +195,7 @@ void WorkerGlobalScope::initialize_policy_container(GC::Ref<Fetch::Infrastructur
|
|||
|
||||
// 2. Otherwise, set workerGlobalScope's policy container to the result of creating a policy container from a fetch
|
||||
// response given response and environment.
|
||||
m_policy_container = create_a_policy_container_from_a_fetch_response(realm, response, environment);
|
||||
m_policy_container = create_a_policy_container_from_a_fetch_response(realm.heap(), response, environment);
|
||||
}
|
||||
|
||||
// https://w3c.github.io/webappsec-csp/#run-global-object-csp-initialization
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue