mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-08 18:46:03 +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
Notes:
sideshowbarker
2024-07-16 20:21:48 +09:00
Author: https://github.com/tcl3
Commit: ae42c6ed80
Pull-request: https://github.com/SerenityOS/serenity/pull/23354
Reviewed-by: https://github.com/trflynn89
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