Files
ladybird/Libraries/LibWeb/HTML/DedicatedWorkerGlobalScope.h
Shannon Booth 5adfd1c43a LibWeb/Bindings: Generate struct definitions from IDL dictionaries
Previously we were inconsistent by generating code for enum definitions
but not generating code for dictionaries. With future changes to the
IDL generator to expose helpers to convert to and from IDL values
this produced circular depdendencies. To solve this problem, also
generate the dictionary definitions in bindings headers.
2026-05-09 10:49:49 +02:00

47 lines
1.3 KiB
C++

/*
* Copyright (c) 2024, Andrew Kaster <akaster@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibWeb/Bindings/DedicatedWorkerGlobalScope.h>
#include <LibWeb/Bindings/WorkerGlobalScope.h>
#include <LibWeb/Export.h>
#include <LibWeb/HTML/WorkerGlobalScope.h>
namespace Web::HTML {
class WEB_API DedicatedWorkerGlobalScope
: public WorkerGlobalScope
, public Bindings::DedicatedWorkerGlobalScopeGlobalMixin {
WEB_PLATFORM_OBJECT(DedicatedWorkerGlobalScope, WorkerGlobalScope);
GC_DECLARE_ALLOCATOR(DedicatedWorkerGlobalScope);
public:
static constexpr bool OVERRIDES_FINALIZE = true;
virtual ~DedicatedWorkerGlobalScope() override;
WebIDL::ExceptionOr<void> post_message(JS::Value message, Bindings::StructuredSerializeOptions const&);
WebIDL::ExceptionOr<void> post_message(JS::Value message, Vector<GC::Root<JS::Object>> const& transfer);
void close();
WebIDL::CallbackType* onmessage();
void set_onmessage(WebIDL::CallbackType* callback);
WebIDL::CallbackType* onmessageerror();
void set_onmessageerror(WebIDL::CallbackType* callback);
virtual void finalize() override;
private:
DedicatedWorkerGlobalScope(JS::Realm&, GC::Ref<Web::Page>);
virtual void initialize_web_interfaces_impl() override;
};
}