1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-18 13:15:08 +00:00
serenity/Userland/Libraries/LibWeb/Bindings/MainThreadVM.h
Lenny Maiorani c37820b898 Libraries: Use default constructors/destructors in LibWeb
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules

"The compiler is more likely to get the default semantics right and
you cannot implement these functions better than the compiler."
2022-03-17 17:23:49 +00:00

39 lines
1.1 KiB
C++

/*
* Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
* Copyright (c) 2021, Luke Wilde <lukew@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibJS/Forward.h>
#include <LibJS/Runtime/JobCallback.h>
#include <LibJS/Runtime/VM.h>
#include <LibWeb/HTML/EventLoop/EventLoop.h>
namespace Web::Bindings {
struct WebEngineCustomData final : public JS::VM::CustomData {
virtual ~WebEngineCustomData() override = default;
HTML::EventLoop event_loop;
};
struct WebEngineCustomJobCallbackData final : public JS::JobCallback::CustomData {
WebEngineCustomJobCallbackData(HTML::EnvironmentSettingsObject& incumbent_settings, OwnPtr<JS::ExecutionContext> active_script_context)
: incumbent_settings(incumbent_settings)
, active_script_context(move(active_script_context))
{
}
virtual ~WebEngineCustomJobCallbackData() override = default;
HTML::EnvironmentSettingsObject& incumbent_settings;
OwnPtr<JS::ExecutionContext> active_script_context;
};
HTML::ClassicScript* active_script();
JS::VM& main_thread_vm();
}