ladybird/Libraries/LibWeb/HTML/ShadowRealmGlobalScope.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

53 lines
1.6 KiB
C++

/*
* Copyright (c) 2024, Shannon Booth <shannon@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibWeb/Bindings/Intrinsics.h>
#include <LibWeb/Bindings/ShadowRealmGlobalScopeGlobalMixin.h>
#include <LibWeb/DOM/EventTarget.h>
#include <LibWeb/HTML/UniversalGlobalScope.h>
namespace Web::HTML {
// https://whatpr.org/html/9893/webappapis.html#shadowrealmglobalscope
class ShadowRealmGlobalScope
: public DOM::EventTarget
, public UniversalGlobalScopeMixin
, public Bindings::ShadowRealmGlobalScopeGlobalMixin {
WEB_PLATFORM_OBJECT(ShadowRealmGlobalScope, DOM::EventTarget);
GC_DECLARE_ALLOCATOR(ShadowRealmGlobalScope);
public:
virtual ~ShadowRealmGlobalScope() override;
static GC::Ref<ShadowRealmGlobalScope> create(JS::Realm&);
virtual Bindings::PlatformObject& this_impl() override { return *this; }
virtual Bindings::PlatformObject const& this_impl() const override { return *this; }
// https://whatpr.org/html/9893/webappapis.html#dom-shadowrealmglobalscope-self
GC::Ref<ShadowRealmGlobalScope> self()
{
// The self getter steps are to return this.
return *this;
}
using UniversalGlobalScopeMixin::atob;
using UniversalGlobalScopeMixin::btoa;
using UniversalGlobalScopeMixin::queue_microtask;
using UniversalGlobalScopeMixin::structured_clone;
void initialize_web_interfaces();
protected:
explicit ShadowRealmGlobalScope(JS::Realm&);
virtual void initialize(JS::Realm&) override;
virtual void visit_edges(Cell::Visitor&) override;
};
}