LibWeb: Add IDL definition for Web::Streams::QueuingStrategy

This commit is contained in:
Shannon Booth 2023-06-18 21:21:34 +12:00 committed by Andreas Kling
parent 9df2d6ee0f
commit 42c102ecb6
3 changed files with 29 additions and 0 deletions

View file

@ -550,6 +550,7 @@ class WritableStreamDefaultController;
class WritableStreamDefaultWriter;
struct PullIntoDescriptor;
struct QueuingStrategy;
struct QueuingStrategyInit;
struct UnderlyingSink;
struct UnderlyingSource;

View file

@ -0,0 +1,21 @@
/*
* Copyright (c) 2023, Shannon Booth <shannon.ml.booth@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Optional.h>
#include <LibJS/Heap/GCPtr.h>
#include <LibWeb/WebIDL/CallbackType.h>
namespace Web::Streams {
// https://streams.spec.whatwg.org/#dictdef-queuingstrategy
struct QueuingStrategy {
Optional<double> high_water_mark;
JS::GCPtr<WebIDL::CallbackType> size;
};
}

View file

@ -0,0 +1,7 @@
callback QueuingStrategySize = unrestricted double (any chunk);
// https://streams.spec.whatwg.org/#dictdef-queuingstrategy
dictionary QueuingStrategy {
unrestricted double highWaterMark;
QueuingStrategySize size;
};