/* * Copyright (c) 2023, Linus Groh * Copyright (c) 2023, Luke Wilde * Copyright (c) 2024, Shannon Booth * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include #include namespace Web::HTML { // https://whatpr.org/html/9893/webappapis.html#universalglobalscope-mixin class UniversalGlobalScopeMixin { public: virtual ~UniversalGlobalScopeMixin(); virtual Bindings::PlatformObject& this_impl() = 0; virtual Bindings::PlatformObject const& this_impl() const = 0; WebIDL::ExceptionOr btoa(String const& data) const; WebIDL::ExceptionOr atob(String const& data) const; void queue_microtask(WebIDL::CallbackType&); WebIDL::ExceptionOr structured_clone(JS::Value, StructuredSerializeOptions const&) const; GC::Ref count_queuing_strategy_size_function(); GC::Ref byte_length_queuing_strategy_size_function(); protected: void visit_edges(GC::Cell::Visitor&); private: // https://streams.spec.whatwg.org/#count-queuing-strategy-size-function GC::Ptr m_count_queuing_strategy_size_function; // https://streams.spec.whatwg.org/#byte-length-queuing-strategy-size-function GC::Ptr m_byte_length_queuing_strategy_size_function; }; }