ladybird/Libraries/LibWeb/Streams/ByteLengthQueuingStrategy.h
Shannon Booth f87041bf3a LibGC+Everywhere: Factor out a LibGC from LibJS
Resulting in a massive rename across almost everywhere! Alongside the
namespace change, we now have the following names:

 * JS::NonnullGCPtr -> GC::Ref
 * JS::GCPtr -> GC::Ptr
 * JS::HeapFunction -> GC::Function
 * JS::CellImpl -> GC::Cell
 * JS::Handle -> GC::Root
2024-11-15 14:49:20 +01:00

46 lines
1.3 KiB
C++

/*
* Copyright (c) 2023, Shannon Booth <shannon@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/Streams/QueuingStrategyInit.h>
namespace Web::Streams {
// https://streams.spec.whatwg.org/#bytelengthqueuingstrategy
class ByteLengthQueuingStrategy final : public Bindings::PlatformObject {
WEB_PLATFORM_OBJECT(ByteLengthQueuingStrategy, Bindings::PlatformObject);
GC_DECLARE_ALLOCATOR(ByteLengthQueuingStrategy);
public:
static GC::Ref<ByteLengthQueuingStrategy> construct_impl(JS::Realm&, QueuingStrategyInit const&);
virtual ~ByteLengthQueuingStrategy() override;
// https://streams.spec.whatwg.org/#blqs-high-water-mark
double high_water_mark() const
{
// The highWaterMark getter steps are:
// 1. Return this.[[highWaterMark]].
return m_high_water_mark;
}
GC::Ref<WebIDL::CallbackType> size();
private:
explicit ByteLengthQueuingStrategy(JS::Realm&, double high_water_mark);
virtual void initialize(JS::Realm&) override;
// https://streams.spec.whatwg.org/#bytelengthqueuingstrategy-highwatermark
double m_high_water_mark { 0 };
};
}