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

LibWeb: Set up the DefaultController when constructing a WritableStream

This commit is contained in:
Matthew Olsson 2023-04-09 15:22:01 -07:00 committed by Linus Groh
parent 58f3009faa
commit 0a220a19da
5 changed files with 161 additions and 2 deletions

View file

@ -21,6 +21,7 @@ public:
WebIDL::ExceptionOr<void> error(JS::Value error);
JS::NonnullGCPtr<DOM::AbortSignal> signal() { return *m_signal; }
void set_signal(JS::NonnullGCPtr<DOM::AbortSignal> value) { m_signal = value; }
auto& abort_algorithm() { return m_abort_algorithm; }
void set_abort_algorithm(Optional<AbortAlgorithm>&& value) { m_abort_algorithm = move(value); }
@ -52,6 +53,8 @@ public:
void error_steps();
private:
explicit WritableStreamDefaultController(JS::Realm&);
// https://streams.spec.whatwg.org/#writablestreamdefaultcontroller-abortalgorithm
// A promise-returning algorithm, taking one argument (the abort reason), which communicates a requested abort to the underlying sink
Optional<AbortAlgorithm> m_abort_algorithm;