mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-27 03:37:53 +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:
@@ -163,8 +163,8 @@ void BrowsingContextContainer::shared_attribute_processing_steps_for_iframe_and_
|
||||
}
|
||||
|
||||
// 5. Let resource be a new request whose URL is url and whose referrer policy is the current state of element's referrerpolicy content attribute.
|
||||
auto resource = Fetch::Infrastructure::Request();
|
||||
resource.set_url(url);
|
||||
auto resource = Fetch::Infrastructure::Request::create();
|
||||
resource->set_url(url);
|
||||
// FIXME: Set the referrer policy.
|
||||
|
||||
// AD-HOC:
|
||||
@@ -191,7 +191,7 @@ void BrowsingContextContainer::shared_attribute_processing_steps_for_iframe_and_
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/iframe-embed-object.html#navigate-an-iframe-or-frame
|
||||
void BrowsingContextContainer::navigate_an_iframe_or_frame(Fetch::Infrastructure::Request resource)
|
||||
void BrowsingContextContainer::navigate_an_iframe_or_frame(NonnullRefPtr<Fetch::Infrastructure::Request> resource)
|
||||
{
|
||||
// 1. Let historyHandling be "default".
|
||||
auto history_handling = HistoryHandlingBehavior::Default;
|
||||
|
||||
Reference in New Issue
Block a user