LibWeb: Make Fetch::Request follow abort signals where appropriate

This commit is contained in:
Luke Wilde 2022-10-26 18:17:47 +01:00 committed by Linus Groh
parent dce6327ae7
commit 5cc190ad70
Notes: sideshowbarker 2024-07-17 05:05:13 +09:00

View File

@ -385,9 +385,8 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<Request>> Request::construct_impl(JS::Realm
request_object->m_signal = realm.heap().allocate<DOM::AbortSignal>(this_relevant_realm, this_relevant_realm); request_object->m_signal = realm.heap().allocate<DOM::AbortSignal>(this_relevant_realm, this_relevant_realm);
// 29. If signal is not null, then make thiss signal follow signal. // 29. If signal is not null, then make thiss signal follow signal.
if (input_signal != nullptr) { if (input_signal != nullptr)
// FIXME: Our AbortSignal doesn't support 'following' yet. request_object->m_signal->follow(*input_signal);
}
// 30. Set thiss headers to a new Headers object with thiss relevant Realm, whose header list is requests header list and guard is "request". // 30. Set thiss headers to a new Headers object with thiss relevant Realm, whose header list is requests header list and guard is "request".
request_object->m_headers = realm.heap().allocate<Headers>(realm, realm); request_object->m_headers = realm.heap().allocate<Headers>(realm, realm);
@ -635,7 +634,8 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<Request>> Request::clone() const
// 3. Let clonedRequestObject be the result of creating a Request object, given clonedRequest, thiss headerss guard, and thiss relevant Realm. // 3. Let clonedRequestObject be the result of creating a Request object, given clonedRequest, thiss headerss guard, and thiss relevant Realm.
auto cloned_request_object = Request::create(move(cloned_request), m_headers->guard(), HTML::relevant_realm(*this)); auto cloned_request_object = Request::create(move(cloned_request), m_headers->guard(), HTML::relevant_realm(*this));
// FIXME: 4. Make clonedRequestObjects signal follow thiss signal. // 4. Make clonedRequestObjects signal follow thiss signal.
cloned_request_object->m_signal->follow(*m_signal);
// 5. Return clonedRequestObject. // 5. Return clonedRequestObject.
return cloned_request_object; return cloned_request_object;