mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +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:
@@ -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") {
|
||||
|
||||
Reference in New Issue
Block a user