LibWeb: Remove exceptional return types from infallible stream IDL

This commit is contained in:
Timothy Flynn 2024-04-29 18:34:19 -04:00 committed by Andreas Kling
commit 2d4d16ac37
Notes: sideshowbarker 2024-07-16 23:51:07 +09:00
15 changed files with 26 additions and 29 deletions

View file

@ -9,14 +9,13 @@
#include <LibWeb/Bindings/Intrinsics.h>
#include <LibWeb/HTML/Window.h>
#include <LibWeb/Streams/CountQueuingStrategy.h>
#include <LibWeb/WebIDL/ExceptionOr.h>
namespace Web::Streams {
JS_DEFINE_ALLOCATOR(CountQueuingStrategy);
// https://streams.spec.whatwg.org/#blqs-constructor
WebIDL::ExceptionOr<JS::NonnullGCPtr<CountQueuingStrategy>> CountQueuingStrategy::construct_impl(JS::Realm& realm, QueuingStrategyInit const& init)
JS::NonnullGCPtr<CountQueuingStrategy> CountQueuingStrategy::construct_impl(JS::Realm& realm, QueuingStrategyInit const& init)
{
// The new CountQueuingStrategy(init) constructor steps are:
// 1. Set this.[[highWaterMark]] to init["highWaterMark"].
@ -32,7 +31,7 @@ CountQueuingStrategy::CountQueuingStrategy(JS::Realm& realm, double high_water_m
CountQueuingStrategy::~CountQueuingStrategy() = default;
// https://streams.spec.whatwg.org/#cqs-size
WebIDL::ExceptionOr<JS::NonnullGCPtr<WebIDL::CallbackType>> CountQueuingStrategy::size()
JS::NonnullGCPtr<WebIDL::CallbackType> CountQueuingStrategy::size()
{
// 1. Return this's relevant global object's count queuing strategy size function.
return global_object().count_queuing_strategy_size_function();