1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:47:34 +00:00

LibWeb: Move main thread JavaScript VM to its own file

Instead of being a weird little global function in DOM/Document.cpp,
you can now get the main thread JS VM via Bindings::main_thread_vm().
This commit is contained in:
Andreas Kling 2021-02-03 10:41:07 +01:00
parent cc2f35badd
commit 342b787d1c
5 changed files with 83 additions and 19 deletions

View file

@ -30,6 +30,7 @@
#include <LibGfx/SystemTheme.h>
#include <LibJS/Heap/Heap.h>
#include <LibJS/Runtime/VM.h>
#include <LibWeb/Bindings/MainThreadVM.h>
#include <LibWeb/DOM/Document.h>
#include <LibWeb/Dump.h>
#include <LibWeb/Layout/InitialContainingBlockBox.h>
@ -39,10 +40,6 @@
#include <WebContent/WebContentClientEndpoint.h>
#include <pthread.h>
namespace Web::DOM {
extern JS::VM& main_thread_vm();
}
namespace WebContent {
static HashMap<int, RefPtr<ClientConnection>> s_connections;
@ -197,7 +194,7 @@ void ClientConnection::handle(const Messages::WebContentServer::DebugRequest& me
}
if (message.request() == "collect-garbage") {
::Web::DOM::main_thread_vm().heap().collect_garbage(JS::Heap::CollectionType::CollectGarbage, true);
Web::Bindings::main_thread_vm().heap().collect_garbage(JS::Heap::CollectionType::CollectGarbage, true);
}
if (message.request() == "set-line-box-borders") {