1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 20:17:44 +00:00

Browser+LibWebView: Run with the JavaScript bytecode VM by default

The AST interpreter is still available behind a new `--ast` flag.
This commit is contained in:
Andreas Kling 2023-07-25 17:42:22 +02:00
parent c3e5487f00
commit a3e97ea153
9 changed files with 25 additions and 7 deletions

View file

@ -14,6 +14,7 @@
#include <LibGfx/Bitmap.h>
#include <LibGfx/Font/FontDatabase.h>
#include <LibGfx/SystemTheme.h>
#include <LibJS/Bytecode/Interpreter.h>
#include <LibJS/Console.h>
#include <LibJS/Heap/Heap.h>
#include <LibJS/Runtime/ConsoleObject.h>
@ -64,6 +65,11 @@ Web::Page const& ConnectionFromClient::page() const
return m_page_host->page();
}
void ConnectionFromClient::set_use_javascript_bytecode(bool use_bytecode)
{
JS::Bytecode::Interpreter::set_enabled(use_bytecode);
}
Messages::WebContentServer::GetWindowHandleResponse ConnectionFromClient::get_window_handle()
{
return m_page_host->page().top_level_browsing_context().window_handle();

View file

@ -48,6 +48,7 @@ private:
Web::Page& page();
Web::Page const& page() const;
virtual void set_use_javascript_bytecode(bool) override;
virtual Messages::WebContentServer::GetWindowHandleResponse get_window_handle() override;
virtual void set_window_handle(String const& handle) override;
virtual void connect_to_webdriver(DeprecatedString const& webdriver_ipc_path) override;

View file

@ -9,6 +9,9 @@
endpoint WebContentServer
{
// NOTE: This is only used on SerenityOS when attaching to a WebContent process served by SystemServer.
set_use_javascript_bytecode(bool use_javascript_bytecode) =|
get_window_handle() => (String handle)
set_window_handle(String handle) =|