1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 09:18:11 +00:00
serenity/Userland/Libraries/LibWeb/Bindings/WindowObject.h
Andreas Kling 6f433c8656 LibWeb+LibJS: Make the EventTarget hierarchy (incl. DOM) GC-allocated
This is a monster patch that turns all EventTargets into GC-allocated
PlatformObjects. Their C++ wrapper classes are removed, and the LibJS
garbage collector is now responsible for their lifetimes.

There's a fair amount of hacks and band-aids in this patch, and we'll
have a lot of cleanup to do after this.
2022-09-06 00:27:09 +02:00

38 lines
1,000 B
C++

/*
* Copyright (c) 2020-2022, Andreas Kling <kling@serenityos.org>
* Copyright (c) 2021, Sam Atkins <atkinssj@serenityos.org>
* Copyright (c) 2021-2022, Linus Groh <linusg@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/TypeCasts.h>
#include <AK/Variant.h>
#include <AK/Weakable.h>
#include <LibJS/Runtime/Completion.h>
#include <LibJS/Runtime/GlobalObject.h>
#include <LibWeb/Bindings/CallbackType.h>
#include <LibWeb/Bindings/CrossOriginAbstractOperations.h>
#include <LibWeb/Forward.h>
#include <LibWeb/HTML/GlobalEventHandlers.h>
#include <LibWeb/HTML/Origin.h>
#include <LibWeb/HTML/WindowEventHandlers.h>
namespace Web {
namespace Bindings {
class WindowObject
: public JS::GlobalObject
, public Weakable<WindowObject> {
JS_OBJECT(WindowObject, JS::GlobalObject);
public:
explicit WindowObject(JS::Realm&, HTML::Window&);
virtual void initialize(JS::Realm&) override;
virtual ~WindowObject() override = default;
};
}
}