瀏覽代碼

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

Luke Wilde 2 年之前
父節點
當前提交
5cc190ad70
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      Userland/Libraries/LibWeb/Fetch/Request.cpp

+ 4 - 4
Userland/Libraries/LibWeb/Fetch/Request.cpp

@@ -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 this’s signal follow signal.
     // 29. If signal is not null, then make this’s signal follow signal.
-    if (input_signal != nullptr) {
-        // FIXME: Our AbortSignal doesn't support 'following' yet.
-    }
+    if (input_signal != nullptr)
+        request_object->m_signal->follow(*input_signal);
 
 
     // 30. Set this’s headers to a new Headers object with this’s relevant Realm, whose header list is request’s header list and guard is "request".
     // 30. Set this’s headers to a new Headers object with this’s relevant Realm, whose header list is request’s 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, this’s headers’s guard, and this’s relevant Realm.
     // 3. Let clonedRequestObject be the result of creating a Request object, given clonedRequest, this’s headers’s guard, and this’s 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 clonedRequestObject’s signal follow this’s signal.
+    // 4. Make clonedRequestObject’s signal follow this’s signal.
+    cloned_request_object->m_signal->follow(*m_signal);
 
 
     // 5. Return clonedRequestObject.
     // 5. Return clonedRequestObject.
     return cloned_request_object;
     return cloned_request_object;