1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:08:10 +00:00

LibWeb: Make Fetch::Infrastructure::{Request,Response} ref-counted

With the addition of the 'fetch params' struct, the single ownership
model we had so far falls apart completely.

Additionally, this works nicely for FilteredResponse's internal response
instead of risking a dangling reference.

Replacing the public constructor with a create() function also found a
few instances of a Request being stack-allocated!
This commit is contained in:
Linus Groh 2022-10-04 23:45:47 +01:00
parent 886ca9c7b6
commit 1c12f5c31d
14 changed files with 228 additions and 175 deletions

View file

@ -299,7 +299,7 @@ bool FrameLoader::load(const AK::URL& url, Type type)
void FrameLoader::load_html(StringView html, const AK::URL& url)
{
auto response = make<Fetch::Infrastructure::Response>();
auto response = Fetch::Infrastructure::Response::create();
response->url_list().append(url);
HTML::NavigationParams navigation_params {
.id = {},
@ -419,7 +419,7 @@ void FrameLoader::resource_did_load()
// FIXME: Pass incumbentNavigationOrigin
auto response_origin = HTML::determine_the_origin(browsing_context(), url, final_sandboxing_flag_set, {});
auto response = make<Fetch::Infrastructure::Response>();
auto response = Fetch::Infrastructure::Response::create();
response->url_list().append(url);
HTML::NavigationParams navigation_params {
.id = {},