mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 05:17:34 +00:00
LibWeb: Add UnderlyingSource struct for ReadableStream constructor
This commit is contained in:
parent
bc9919178e
commit
66dec1bf54
4 changed files with 92 additions and 0 deletions
31
Userland/Libraries/LibWeb/Streams/UnderlyingSource.h
Normal file
31
Userland/Libraries/LibWeb/Streams/UnderlyingSource.h
Normal file
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
* Copyright (c) 2023, Matthew Olsson <mattco@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Forward.h>
|
||||
#include <LibJS/Forward.h>
|
||||
#include <LibWeb/Bindings/PlatformObject.h>
|
||||
#include <LibWeb/Forward.h>
|
||||
#include <LibWeb/WebIDL/Promise.h>
|
||||
|
||||
namespace Web::Streams {
|
||||
|
||||
enum class ReadableStreamType {
|
||||
Bytes
|
||||
};
|
||||
|
||||
struct UnderlyingSource {
|
||||
JS::Handle<WebIDL::CallbackType> start;
|
||||
JS::Handle<WebIDL::CallbackType> pull;
|
||||
JS::Handle<WebIDL::CallbackType> cancel;
|
||||
Optional<ReadableStreamType> type;
|
||||
Optional<i64> auto_allocate_chunk_size;
|
||||
|
||||
static JS::ThrowCompletionOr<UnderlyingSource> from_value(JS::VM&, JS::Value);
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue