Jelajahi Sumber

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

This is used in the constructor for ByteLengthQueuingStrategy and
CountQueuingStrategy.
Shannon Booth 2 tahun lalu
induk
melakukan
0d714ad165

+ 1 - 0
Userland/Libraries/LibWeb/Forward.h

@@ -548,6 +548,7 @@ class WritableStreamDefaultController;
 class WritableStreamDefaultWriter;
 
 struct PullIntoDescriptor;
+struct QueuingStrategyInit;
 struct UnderlyingSink;
 struct UnderlyingSource;
 }

+ 16 - 0
Userland/Libraries/LibWeb/Streams/QueuingStrategyInit.h

@@ -0,0 +1,16 @@
+/*
+ * Copyright (c) 2023, Shannon Booth <shannon.ml.booth@gmail.com>
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+#pragma once
+
+namespace Web::Streams {
+
+// https://streams.spec.whatwg.org/#dictdef-queuingstrategyinit
+struct QueuingStrategyInit {
+    double high_water_mark;
+};
+
+}

+ 4 - 0
Userland/Libraries/LibWeb/Streams/QueuingStrategyInit.idl

@@ -0,0 +1,4 @@
+// https://streams.spec.whatwg.org/#dictdef-queuingstrategyinit
+dictionary QueuingStrategyInit {
+    required unrestricted double highWaterMark;
+};