1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 15:07:45 +00:00

LibWeb: Implement AbortSignal.timeout()

This method returns a signal that will automatically abort after a
given number of milliseconds.
This commit is contained in:
Tim Ledbetter 2024-02-26 17:52:32 +00:00 committed by Tim Flynn
parent 3c288c96e6
commit ae42c6ed80
5 changed files with 48 additions and 1 deletions

View file

@ -11,6 +11,7 @@
#include <LibJS/Heap/HeapFunction.h>
#include <LibWeb/DOM/EventTarget.h>
#include <LibWeb/Forward.h>
#include <LibWeb/WebIDL/Types.h>
namespace Web::DOM {
@ -44,6 +45,7 @@ public:
void follow(JS::NonnullGCPtr<AbortSignal> parent_signal);
static WebIDL::ExceptionOr<JS::NonnullGCPtr<AbortSignal>> abort(JS::VM&, JS::Value reason);
static WebIDL::ExceptionOr<JS::NonnullGCPtr<AbortSignal>> timeout(JS::VM&, Web::WebIDL::UnsignedLongLong milliseconds);
private:
explicit AbortSignal(JS::Realm&);