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:
parent
3c288c96e6
commit
ae42c6ed80
5 changed files with 48 additions and 1 deletions
|
@ -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&);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue