From 99ac34eeae864b2ec90dd3e428fbdf8bb79b27da Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 7 Aug 2023 16:44:20 +0200 Subject: [PATCH] Ladybird+LibWebView+Browser: Remove ability to run with AST interpreter --- Ladybird/HelperProcess.cpp | 3 --- Ladybird/HelperProcess.h | 1 - Ladybird/Qt/BrowserWindow.cpp | 5 ++--- Ladybird/Qt/BrowserWindow.h | 3 +-- Ladybird/Qt/ConsoleWidget.cpp | 2 +- Ladybird/Qt/Tab.cpp | 4 ++-- Ladybird/Qt/Tab.h | 2 +- Ladybird/Qt/WebContentView.cpp | 7 +++---- Ladybird/Qt/WebContentView.h | 2 +- Ladybird/Qt/main.cpp | 2 +- Ladybird/WebContent/main.cpp | 4 ---- Userland/Applications/Browser/BrowserWindow.cpp | 5 ++--- Userland/Applications/Browser/BrowserWindow.h | 4 +--- Userland/Applications/Browser/Tab.cpp | 4 ++-- Userland/Applications/Browser/Tab.h | 2 +- Userland/Applications/Browser/main.cpp | 2 +- .../Libraries/LibWebView/OutOfProcessWebView.cpp | 5 +---- .../Libraries/LibWebView/OutOfProcessWebView.h | 2 +- .../Libraries/LibWebView/ViewImplementation.cpp | 3 +-- Userland/Libraries/LibWebView/ViewImplementation.h | 11 +---------- .../Services/WebContent/ConnectionFromClient.cpp | 5 ----- .../Services/WebContent/ConnectionFromClient.h | 1 - Userland/Services/WebContent/WebContentServer.ipc | 3 --- Userland/Utilities/headless-browser.cpp | 14 +++++--------- 24 files changed, 28 insertions(+), 68 deletions(-) diff --git a/Ladybird/HelperProcess.cpp b/Ladybird/HelperProcess.cpp index c8453b221f..cef3a5c4dd 100644 --- a/Ladybird/HelperProcess.cpp +++ b/Ladybird/HelperProcess.cpp @@ -10,7 +10,6 @@ ErrorOr> launch_web_content_process(Web ReadonlySpan candidate_web_content_paths, WebView::EnableCallgrindProfiling enable_callgrind_profiling, WebView::IsLayoutTestMode is_layout_test_mode, - WebView::UseJavaScriptBytecode use_javascript_bytecode, Ladybird::UseLagomNetworking use_lagom_networking) { int socket_fds[2] {}; @@ -53,8 +52,6 @@ ErrorOr> launch_web_content_process(Web arguments.remove(0, callgrind_prefix_length); if (is_layout_test_mode == WebView::IsLayoutTestMode::Yes) arguments.append("--layout-test-mode"sv); - if (use_javascript_bytecode == WebView::UseJavaScriptBytecode::Yes) - arguments.append("--use-bytecode"sv); if (use_lagom_networking == Ladybird::UseLagomNetworking::Yes) arguments.append("--use-lagom-networking"sv); diff --git a/Ladybird/HelperProcess.h b/Ladybird/HelperProcess.h index d5013bc538..e46f960283 100644 --- a/Ladybird/HelperProcess.h +++ b/Ladybird/HelperProcess.h @@ -19,7 +19,6 @@ ErrorOr> launch_web_content_process(Web ReadonlySpan candidate_web_content_paths, WebView::EnableCallgrindProfiling, WebView::IsLayoutTestMode, - WebView::UseJavaScriptBytecode, Ladybird::UseLagomNetworking); ErrorOr> launch_request_server_process(ReadonlySpan candidate_request_server_paths, StringView serenity_resource_root); diff --git a/Ladybird/Qt/BrowserWindow.cpp b/Ladybird/Qt/BrowserWindow.cpp index df0d8fef57..1ec4adcae1 100644 --- a/Ladybird/Qt/BrowserWindow.cpp +++ b/Ladybird/Qt/BrowserWindow.cpp @@ -40,11 +40,10 @@ static QIcon const& app_icon() return icon; } -BrowserWindow::BrowserWindow(Browser::CookieJar& cookie_jar, StringView webdriver_content_ipc_path, WebView::EnableCallgrindProfiling enable_callgrind_profiling, WebView::UseJavaScriptBytecode use_javascript_bytecode, UseLagomNetworking use_lagom_networking) +BrowserWindow::BrowserWindow(Browser::CookieJar& cookie_jar, StringView webdriver_content_ipc_path, WebView::EnableCallgrindProfiling enable_callgrind_profiling, UseLagomNetworking use_lagom_networking) : m_cookie_jar(cookie_jar) , m_webdriver_content_ipc_path(webdriver_content_ipc_path) , m_enable_callgrind_profiling(enable_callgrind_profiling) - , m_use_javascript_bytecode(use_javascript_bytecode) , m_use_lagom_networking(use_lagom_networking) { setWindowIcon(app_icon()); @@ -420,7 +419,7 @@ void BrowserWindow::debug_request(DeprecatedString const& request, DeprecatedStr Tab& BrowserWindow::new_tab(QString const& url, Web::HTML::ActivateTab activate_tab) { - auto tab = make(this, m_webdriver_content_ipc_path, m_enable_callgrind_profiling, m_use_javascript_bytecode, m_use_lagom_networking); + auto tab = make(this, m_webdriver_content_ipc_path, m_enable_callgrind_profiling, m_use_lagom_networking); auto tab_ptr = tab.ptr(); m_tabs.append(std::move(tab)); diff --git a/Ladybird/Qt/BrowserWindow.h b/Ladybird/Qt/BrowserWindow.h index a58d8656d5..6977eae8b9 100644 --- a/Ladybird/Qt/BrowserWindow.h +++ b/Ladybird/Qt/BrowserWindow.h @@ -28,7 +28,7 @@ class WebContentView; class BrowserWindow : public QMainWindow { Q_OBJECT public: - explicit BrowserWindow(Browser::CookieJar&, StringView webdriver_content_ipc_path, WebView::EnableCallgrindProfiling, WebView::UseJavaScriptBytecode, UseLagomNetworking); + explicit BrowserWindow(Browser::CookieJar&, StringView webdriver_content_ipc_path, WebView::EnableCallgrindProfiling, UseLagomNetworking); WebContentView& view() const { return m_current_tab->view(); } @@ -119,7 +119,6 @@ private: StringView m_webdriver_content_ipc_path; WebView::EnableCallgrindProfiling m_enable_callgrind_profiling; - WebView::UseJavaScriptBytecode m_use_javascript_bytecode; UseLagomNetworking m_use_lagom_networking; }; diff --git a/Ladybird/Qt/ConsoleWidget.cpp b/Ladybird/Qt/ConsoleWidget.cpp index 4867034fe7..2e53264ed5 100644 --- a/Ladybird/Qt/ConsoleWidget.cpp +++ b/Ladybird/Qt/ConsoleWidget.cpp @@ -28,7 +28,7 @@ ConsoleWidget::ConsoleWidget() { setLayout(new QVBoxLayout); - m_output_view = new WebContentView({}, WebView::EnableCallgrindProfiling::No, WebView::UseJavaScriptBytecode::No, UseLagomNetworking::No); + m_output_view = new WebContentView({}, WebView::EnableCallgrindProfiling::No, UseLagomNetworking::No); if (is_using_dark_system_theme(*this)) m_output_view->update_palette(WebContentView::PaletteMode::Dark); diff --git a/Ladybird/Qt/Tab.cpp b/Ladybird/Qt/Tab.cpp index 18fb6d44a5..46dc697c39 100644 --- a/Ladybird/Qt/Tab.cpp +++ b/Ladybird/Qt/Tab.cpp @@ -50,7 +50,7 @@ static QIcon create_tvg_icon_with_theme_colors(QString name, QPalette const& pal return QIcon(icon_engine); } -Tab::Tab(BrowserWindow* window, StringView webdriver_content_ipc_path, WebView::EnableCallgrindProfiling enable_callgrind_profiling, WebView::UseJavaScriptBytecode use_javascript_bytecode, UseLagomNetworking use_lagom_networking) +Tab::Tab(BrowserWindow* window, StringView webdriver_content_ipc_path, WebView::EnableCallgrindProfiling enable_callgrind_profiling, UseLagomNetworking use_lagom_networking) : QWidget(window) , m_window(window) { @@ -58,7 +58,7 @@ Tab::Tab(BrowserWindow* window, StringView webdriver_content_ipc_path, WebView:: m_layout->setSpacing(0); m_layout->setContentsMargins(0, 0, 0, 0); - m_view = new WebContentView(webdriver_content_ipc_path, enable_callgrind_profiling, use_javascript_bytecode, use_lagom_networking); + m_view = new WebContentView(webdriver_content_ipc_path, enable_callgrind_profiling, use_lagom_networking); m_toolbar = new QToolBar(this); m_location_edit = new LocationEdit(this); diff --git a/Ladybird/Qt/Tab.h b/Ladybird/Qt/Tab.h index 2d472a7354..ec3c19e9af 100644 --- a/Ladybird/Qt/Tab.h +++ b/Ladybird/Qt/Tab.h @@ -27,7 +27,7 @@ class InspectorWidget; class Tab final : public QWidget { Q_OBJECT public: - Tab(BrowserWindow* window, StringView webdriver_content_ipc_path, WebView::EnableCallgrindProfiling, WebView::UseJavaScriptBytecode, UseLagomNetworking); + Tab(BrowserWindow* window, StringView webdriver_content_ipc_path, WebView::EnableCallgrindProfiling, UseLagomNetworking); virtual ~Tab() override; WebContentView& view() { return *m_view; } diff --git a/Ladybird/Qt/WebContentView.cpp b/Ladybird/Qt/WebContentView.cpp index df0f91af53..b6af2abcda 100644 --- a/Ladybird/Qt/WebContentView.cpp +++ b/Ladybird/Qt/WebContentView.cpp @@ -54,9 +54,8 @@ namespace Ladybird { bool is_using_dark_system_theme(QWidget&); -WebContentView::WebContentView(StringView webdriver_content_ipc_path, WebView::EnableCallgrindProfiling enable_callgrind_profiling, WebView::UseJavaScriptBytecode use_javascript_bytecode, UseLagomNetworking use_lagom_networking) - : WebView::ViewImplementation(use_javascript_bytecode) - , m_use_lagom_networking(use_lagom_networking) +WebContentView::WebContentView(StringView webdriver_content_ipc_path, WebView::EnableCallgrindProfiling enable_callgrind_profiling, UseLagomNetworking use_lagom_networking) + : m_use_lagom_networking(use_lagom_networking) , m_webdriver_content_ipc_path(webdriver_content_ipc_path) { setMouseTracking(true); @@ -545,7 +544,7 @@ void WebContentView::create_client(WebView::EnableCallgrindProfiling enable_call m_client_state = {}; auto candidate_web_content_paths = get_paths_for_helper_process("WebContent"sv).release_value_but_fixme_should_propagate_errors(); - auto new_client = launch_web_content_process(*this, candidate_web_content_paths, enable_callgrind_profiling, WebView::IsLayoutTestMode::No, use_javascript_bytecode(), m_use_lagom_networking).release_value_but_fixme_should_propagate_errors(); + auto new_client = launch_web_content_process(*this, candidate_web_content_paths, enable_callgrind_profiling, WebView::IsLayoutTestMode::No, m_use_lagom_networking).release_value_but_fixme_should_propagate_errors(); m_client_state.client = new_client; m_client_state.client->on_web_content_process_crash = [this] { diff --git a/Ladybird/Qt/WebContentView.h b/Ladybird/Qt/WebContentView.h index 191013e5d3..91e671d469 100644 --- a/Ladybird/Qt/WebContentView.h +++ b/Ladybird/Qt/WebContentView.h @@ -43,7 +43,7 @@ class WebContentView final , public WebView::ViewImplementation { Q_OBJECT public: - explicit WebContentView(StringView webdriver_content_ipc_path, WebView::EnableCallgrindProfiling, WebView::UseJavaScriptBytecode, UseLagomNetworking); + explicit WebContentView(StringView webdriver_content_ipc_path, WebView::EnableCallgrindProfiling, UseLagomNetworking); virtual ~WebContentView() override; Function on_tab_open_request; diff --git a/Ladybird/Qt/main.cpp b/Ladybird/Qt/main.cpp index 45384f24d6..7e206f1db6 100644 --- a/Ladybird/Qt/main.cpp +++ b/Ladybird/Qt/main.cpp @@ -108,7 +108,7 @@ ErrorOr serenity_main(Main::Arguments arguments) auto cookie_jar = database ? TRY(Browser::CookieJar::create(*database)) : Browser::CookieJar::create(); Ladybird::s_settings = adopt_own_if_nonnull(new Ladybird::Settings()); - Ladybird::BrowserWindow window(cookie_jar, webdriver_content_ipc_path, enable_callgrind_profiling ? WebView::EnableCallgrindProfiling::Yes : WebView::EnableCallgrindProfiling::No, WebView::UseJavaScriptBytecode::Yes, use_lagom_networking ? Ladybird::UseLagomNetworking::Yes : Ladybird::UseLagomNetworking::No); + Ladybird::BrowserWindow window(cookie_jar, webdriver_content_ipc_path, enable_callgrind_profiling ? WebView::EnableCallgrindProfiling::Yes : WebView::EnableCallgrindProfiling::No, use_lagom_networking ? Ladybird::UseLagomNetworking::Yes : Ladybird::UseLagomNetworking::No); window.setWindowTitle("Ladybird"); window.resize(800, 600); window.show(); diff --git a/Ladybird/WebContent/main.cpp b/Ladybird/WebContent/main.cpp index a858e2cf24..d8965135c7 100644 --- a/Ladybird/WebContent/main.cpp +++ b/Ladybird/WebContent/main.cpp @@ -65,13 +65,11 @@ ErrorOr serenity_main(Main::Arguments arguments) int webcontent_fd_passing_socket { -1 }; bool is_layout_test_mode = false; - bool use_javascript_bytecode = false; bool use_lagom_networking = false; Core::ArgsParser args_parser; args_parser.add_option(webcontent_fd_passing_socket, "File descriptor of the passing socket for the WebContent connection", "webcontent-fd-passing-socket", 'c', "webcontent_fd_passing_socket"); args_parser.add_option(is_layout_test_mode, "Is layout test mode", "layout-test-mode", 0); - args_parser.add_option(use_javascript_bytecode, "Enable JavaScript bytecode VM", "use-bytecode", 0); args_parser.add_option(use_lagom_networking, "Enable Lagom servers for networking", "use-lagom-networking", 0); args_parser.parse(arguments); @@ -90,8 +88,6 @@ ErrorOr serenity_main(Main::Arguments arguments) Web::HTML::Window::set_internals_object_exposed(is_layout_test_mode); - JS::Bytecode::Interpreter::set_enabled(use_javascript_bytecode); - VERIFY(webcontent_fd_passing_socket >= 0); Web::Platform::FontPlugin::install(*new Ladybird::FontPlugin(is_layout_test_mode)); diff --git a/Userland/Applications/Browser/BrowserWindow.cpp b/Userland/Applications/Browser/BrowserWindow.cpp index 2ef1ed25e6..13e486f9cd 100644 --- a/Userland/Applications/Browser/BrowserWindow.cpp +++ b/Userland/Applications/Browser/BrowserWindow.cpp @@ -57,10 +57,9 @@ static DeprecatedString search_engines_file_path() return builder.to_deprecated_string(); } -BrowserWindow::BrowserWindow(CookieJar& cookie_jar, URL url, WebView::UseJavaScriptBytecode use_javascript_bytecode) +BrowserWindow::BrowserWindow(CookieJar& cookie_jar, URL url) : m_cookie_jar(cookie_jar) , m_window_actions(*this) - , m_use_javascript_bytecode(use_javascript_bytecode) { auto app_icon = GUI::Icon::default_icon("app-browser"sv); m_bookmarks_bar = Browser::BookmarksBarWidget::construct(Browser::bookmarks_file_path(), true); @@ -564,7 +563,7 @@ void BrowserWindow::set_window_title_for_tab(Tab const& tab) Tab& BrowserWindow::create_new_tab(URL url, Web::HTML::ActivateTab activate) { - auto& new_tab = m_tab_widget->add_tab("New tab"_string, *this, m_use_javascript_bytecode); + auto& new_tab = m_tab_widget->add_tab("New tab"_string, *this); m_tab_widget->set_bar_visible(!is_fullscreen() && m_tab_widget->children().size() > 1); diff --git a/Userland/Applications/Browser/BrowserWindow.h b/Userland/Applications/Browser/BrowserWindow.h index ca39c976ae..795672cb31 100644 --- a/Userland/Applications/Browser/BrowserWindow.h +++ b/Userland/Applications/Browser/BrowserWindow.h @@ -51,7 +51,7 @@ public: void broadcast_window_size(Gfx::IntSize); private: - BrowserWindow(CookieJar&, URL, WebView::UseJavaScriptBytecode); + BrowserWindow(CookieJar&, URL); void build_menus(); ErrorOr load_search_engines(GUI::Menu& settings_menu); @@ -87,8 +87,6 @@ private: RefPtr m_disable_user_agent_spoofing; RefPtr m_disable_search_engine_action; RefPtr m_change_homepage_action; - - WebView::UseJavaScriptBytecode m_use_javascript_bytecode {}; }; } diff --git a/Userland/Applications/Browser/Tab.cpp b/Userland/Applications/Browser/Tab.cpp index 3b530793e7..7c51818fc1 100644 --- a/Userland/Applications/Browser/Tab.cpp +++ b/Userland/Applications/Browser/Tab.cpp @@ -114,7 +114,7 @@ void Tab::update_status(Optional text_override, i32 count_waiting) } } -Tab::Tab(BrowserWindow& window, WebView::UseJavaScriptBytecode use_javascript_bytecode) +Tab::Tab(BrowserWindow& window) { load_from_gml(tab_gml).release_value_but_fixme_should_propagate_errors(); @@ -123,7 +123,7 @@ Tab::Tab(BrowserWindow& window, WebView::UseJavaScriptBytecode use_javascript_by auto& webview_container = *find_descendant_of_type_named("webview_container"); - m_web_content_view = webview_container.add(use_javascript_bytecode); + m_web_content_view = webview_container.add(); auto preferred_color_scheme = Web::CSS::preferred_color_scheme_from_string(Config::read_string("Browser"sv, "Preferences"sv, "ColorScheme"sv, Browser::default_color_scheme)); m_web_content_view->set_preferred_color_scheme(preferred_color_scheme); diff --git a/Userland/Applications/Browser/Tab.h b/Userland/Applications/Browser/Tab.h index 67cf4dc681..780f7cc830 100644 --- a/Userland/Applications/Browser/Tab.h +++ b/Userland/Applications/Browser/Tab.h @@ -99,7 +99,7 @@ public: WebView::OutOfProcessWebView& view() { return *m_web_content_view; } private: - Tab(BrowserWindow&, WebView::UseJavaScriptBytecode); + explicit Tab(BrowserWindow&); virtual void show_event(GUI::ShowEvent&) override; virtual void hide_event(GUI::HideEvent&) override; diff --git a/Userland/Applications/Browser/main.cpp b/Userland/Applications/Browser/main.cpp index 555841cb70..22d28c20c4 100644 --- a/Userland/Applications/Browser/main.cpp +++ b/Userland/Applications/Browser/main.cpp @@ -173,7 +173,7 @@ ErrorOr serenity_main(Main::Arguments arguments) first_url = TRY(url_from_argument_string(specified_urls.first())); auto cookie_jar = TRY(Browser::CookieJar::create(*database)); - auto window = Browser::BrowserWindow::construct(cookie_jar, first_url, WebView::UseJavaScriptBytecode::Yes); + auto window = Browser::BrowserWindow::construct(cookie_jar, first_url); auto content_filters_watcher = TRY(Core::FileWatcher::create()); content_filters_watcher->on_change = [&](Core::FileWatcherEvent const&) { diff --git a/Userland/Libraries/LibWebView/OutOfProcessWebView.cpp b/Userland/Libraries/LibWebView/OutOfProcessWebView.cpp index 523194e0c6..97a7c43b52 100644 --- a/Userland/Libraries/LibWebView/OutOfProcessWebView.cpp +++ b/Userland/Libraries/LibWebView/OutOfProcessWebView.cpp @@ -25,8 +25,7 @@ REGISTER_WIDGET(WebView, OutOfProcessWebView) namespace WebView { -OutOfProcessWebView::OutOfProcessWebView(UseJavaScriptBytecode use_javascript_bytecode) - : ViewImplementation(use_javascript_bytecode) +OutOfProcessWebView::OutOfProcessWebView() { set_should_hide_unnecessary_scrollbars(true); set_focus_policy(GUI::FocusPolicy::StrongFocus); @@ -47,8 +46,6 @@ void OutOfProcessWebView::create_client(EnableCallgrindProfiling) }); }; - client().async_set_use_javascript_bytecode(use_javascript_bytecode() == UseJavaScriptBytecode::Yes); - m_client_state.client_handle = Web::Crypto::generate_random_uuid().release_value_but_fixme_should_propagate_errors(); client().async_set_window_handle(m_client_state.client_handle); diff --git a/Userland/Libraries/LibWebView/OutOfProcessWebView.h b/Userland/Libraries/LibWebView/OutOfProcessWebView.h index 03b958c8d6..56ea39aa65 100644 --- a/Userland/Libraries/LibWebView/OutOfProcessWebView.h +++ b/Userland/Libraries/LibWebView/OutOfProcessWebView.h @@ -55,7 +55,7 @@ public: void set_content_scales_to_viewport(bool); private: - explicit OutOfProcessWebView(UseJavaScriptBytecode = UseJavaScriptBytecode::No); + OutOfProcessWebView(); // ^Widget virtual void paint_event(GUI::PaintEvent&) override; diff --git a/Userland/Libraries/LibWebView/ViewImplementation.cpp b/Userland/Libraries/LibWebView/ViewImplementation.cpp index d6f154c6aa..1ddb8cf877 100644 --- a/Userland/Libraries/LibWebView/ViewImplementation.cpp +++ b/Userland/Libraries/LibWebView/ViewImplementation.cpp @@ -14,8 +14,7 @@ namespace WebView { -ViewImplementation::ViewImplementation(UseJavaScriptBytecode use_javascript_bytecode) - : m_use_javascript_bytecode(use_javascript_bytecode) +ViewImplementation::ViewImplementation() { m_backing_store_shrink_timer = Core::Timer::create_single_shot(3000, [this] { resize_backing_stores_if_needed(WindowResizeInProgress::No); diff --git a/Userland/Libraries/LibWebView/ViewImplementation.h b/Userland/Libraries/LibWebView/ViewImplementation.h index f14e058093..b2275e0d93 100644 --- a/Userland/Libraries/LibWebView/ViewImplementation.h +++ b/Userland/Libraries/LibWebView/ViewImplementation.h @@ -30,11 +30,6 @@ enum class IsLayoutTestMode { Yes }; -enum class UseJavaScriptBytecode { - No, - Yes -}; - class ViewImplementation { public: virtual ~ViewImplementation() { } @@ -74,8 +69,6 @@ public: void clear_inspected_dom_node(); i32 get_hovered_node_id(); - UseJavaScriptBytecode use_javascript_bytecode() const { return m_use_javascript_bytecode; } - void debug_request(DeprecatedString const& request, DeprecatedString const& argument = {}); void run_javascript(StringView); @@ -160,7 +153,7 @@ protected: static constexpr auto ZOOM_MAX_LEVEL = 5.0f; static constexpr auto ZOOM_STEP = 0.1f; - explicit ViewImplementation(UseJavaScriptBytecode); + ViewImplementation(); WebContentClient& client(); WebContentClient const& client() const; @@ -208,8 +201,6 @@ protected: size_t m_crash_count = 0; RefPtr m_repeated_crash_timer; - - UseJavaScriptBytecode m_use_javascript_bytecode {}; }; } diff --git a/Userland/Services/WebContent/ConnectionFromClient.cpp b/Userland/Services/WebContent/ConnectionFromClient.cpp index d3b41daa6c..7a4207207a 100644 --- a/Userland/Services/WebContent/ConnectionFromClient.cpp +++ b/Userland/Services/WebContent/ConnectionFromClient.cpp @@ -65,11 +65,6 @@ 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(); diff --git a/Userland/Services/WebContent/ConnectionFromClient.h b/Userland/Services/WebContent/ConnectionFromClient.h index e70042f119..be46ec61ce 100644 --- a/Userland/Services/WebContent/ConnectionFromClient.h +++ b/Userland/Services/WebContent/ConnectionFromClient.h @@ -48,7 +48,6 @@ 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; diff --git a/Userland/Services/WebContent/WebContentServer.ipc b/Userland/Services/WebContent/WebContentServer.ipc index d01fd7e1b7..a54f72ee02 100644 --- a/Userland/Services/WebContent/WebContentServer.ipc +++ b/Userland/Services/WebContent/WebContentServer.ipc @@ -9,9 +9,6 @@ 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) =| diff --git a/Userland/Utilities/headless-browser.cpp b/Userland/Utilities/headless-browser.cpp index 21a1e52c31..35485af5a3 100644 --- a/Userland/Utilities/headless-browser.cpp +++ b/Userland/Utilities/headless-browser.cpp @@ -47,17 +47,16 @@ class HeadlessWebContentView final : public WebView::ViewImplementation { public: - static ErrorOr> create(Core::AnonymousBuffer theme, Gfx::IntSize const& window_size, StringView web_driver_ipc_path, WebView::IsLayoutTestMode is_layout_test_mode = WebView::IsLayoutTestMode::No, WebView::UseJavaScriptBytecode use_javascript_bytecode = WebView::UseJavaScriptBytecode::No) + static ErrorOr> create(Core::AnonymousBuffer theme, Gfx::IntSize const& window_size, StringView web_driver_ipc_path, WebView::IsLayoutTestMode is_layout_test_mode = WebView::IsLayoutTestMode::No) { - auto view = TRY(adopt_nonnull_own_or_enomem(new (nothrow) HeadlessWebContentView(use_javascript_bytecode))); + auto view = TRY(adopt_nonnull_own_or_enomem(new (nothrow) HeadlessWebContentView)); #if defined(AK_OS_SERENITY) view->m_client_state.client = TRY(WebView::WebContentClient::try_create(*view)); (void)is_layout_test_mode; - (void)use_javascript_bytecode; #else auto candidate_web_content_paths = TRY(get_paths_for_helper_process("WebContent"sv)); - view->m_client_state.client = TRY(launch_web_content_process(*view, candidate_web_content_paths, WebView::EnableCallgrindProfiling::No, is_layout_test_mode, use_javascript_bytecode, Ladybird::UseLagomNetworking::No)); + view->m_client_state.client = TRY(launch_web_content_process(*view, candidate_web_content_paths, WebView::EnableCallgrindProfiling::No, is_layout_test_mode, Ladybird::UseLagomNetworking::No)); #endif view->client().async_update_system_theme(move(theme)); @@ -99,10 +98,7 @@ public: } private: - HeadlessWebContentView(WebView::UseJavaScriptBytecode use_javascript_bytecode) - : WebView::ViewImplementation(use_javascript_bytecode) - { - } + HeadlessWebContentView() = default; void notify_server_did_layout(Badge, Gfx::IntSize) override { } void notify_server_did_paint(Badge, i32, Gfx::IntSize) override { } @@ -414,7 +410,7 @@ ErrorOr serenity_main(Main::Arguments arguments) is_layout_test_mode = true; } - auto view = TRY(HeadlessWebContentView::create(move(theme), window_size, web_driver_ipc_path, is_layout_test_mode ? WebView::IsLayoutTestMode::Yes : WebView::IsLayoutTestMode::No, WebView::UseJavaScriptBytecode::Yes)); + auto view = TRY(HeadlessWebContentView::create(move(theme), window_size, web_driver_ipc_path, is_layout_test_mode ? WebView::IsLayoutTestMode::Yes : WebView::IsLayoutTestMode::No)); RefPtr timer; if (!test_root_path.is_empty()) {