mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-07 01:21:57 +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
|
@ -83,6 +83,7 @@ WebIDL::ExceptionOr<GC::Ref<Infrastructure::FetchController>> fetch(JS::Realm& r
|
|||
dbgln_if(WEB_FETCH_DEBUG, "Fetch: Running 'fetch' with: request @ {}", &request);
|
||||
|
||||
auto& vm = realm.vm();
|
||||
auto& heap = vm.heap();
|
||||
|
||||
// 1. Assert: request’s mode is "navigate" or processEarlyHintsResponse is null.
|
||||
VERIFY(request.mode() == Infrastructure::Request::Mode::Navigate || !algorithms.process_early_hints_response());
|
||||
|
@ -185,10 +186,10 @@ WebIDL::ExceptionOr<GC::Ref<Infrastructure::FetchController>> fetch(JS::Realm& r
|
|||
// 1. If request’s client is non-null, then set request’s policy container to a clone of request’s client’s
|
||||
// policy container.
|
||||
if (request.client() != nullptr)
|
||||
request.set_policy_container(request.client()->policy_container()->clone(realm));
|
||||
request.set_policy_container(request.client()->policy_container()->clone(heap));
|
||||
// 2. Otherwise, set request’s policy container to a new policy container.
|
||||
else
|
||||
request.set_policy_container(realm.create<HTML::PolicyContainer>(realm));
|
||||
request.set_policy_container(heap.allocate<HTML::PolicyContainer>(heap));
|
||||
}
|
||||
|
||||
// 13. If request’s header list does not contain `Accept`, then:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue