LibWeb: Move AgentType enum to its own header

This commit is contained in:
Andrew Kaster 2025-05-18 16:22:11 -06:00 committed by Andrew Kaster
commit 978a3b7321
Notes: github-actions[bot] 2025-05-18 23:51:11 +00:00
3 changed files with 23 additions and 9 deletions

View file

@ -0,0 +1,21 @@
/*
* Copyright (c) 2025, Andrew Kaster <andrew@ladybird.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Types.h>
namespace Web::Bindings {
enum class AgentType : u8 {
SimilarOriginWindow,
DedicatedWorker,
SharedWorker,
ServiceWorker,
Worklet,
};
}

View file

@ -10,6 +10,7 @@
#include <LibJS/Forward.h>
#include <LibJS/Runtime/JobCallback.h>
#include <LibJS/Runtime/VM.h>
#include <LibWeb/Bindings/AgentType.h>
#include <LibWeb/DOM/Element.h>
#include <LibWeb/DOM/MutationObserver.h>
#include <LibWeb/HTML/EventLoop/EventLoop.h>
@ -32,14 +33,6 @@ struct WebEngineCustomJobCallbackData final : public JS::JobCallback::CustomData
HTML::Script* active_script();
enum class AgentType : u8 {
SimilarOriginWindow,
DedicatedWorker,
SharedWorker,
ServiceWorker,
Worklet,
};
void initialize_main_thread_vm(AgentType);
JS::VM& main_thread_vm();

View file

@ -20,7 +20,7 @@
#include <LibGfx/Size.h>
#include <LibIPC/Forward.h>
#include <LibURL/URL.h>
#include <LibWeb/Bindings/MainThreadVM.h>
#include <LibWeb/Bindings/AgentType.h>
#include <LibWeb/CSS/PreferredColorScheme.h>
#include <LibWeb/CSS/PreferredContrast.h>
#include <LibWeb/CSS/PreferredMotion.h>