LibWebView+Services+UI: Move the Web plugins to LibWebView

This commit is contained in:
Timothy Flynn 2024-11-10 09:53:15 -05:00 committed by Tim Flynn
commit a14937c45e
Notes: github-actions[bot] 2024-11-11 12:36:47 +00:00
9 changed files with 22 additions and 34 deletions

View file

@ -1,10 +1,7 @@
include(fontconfig)
include(pulseaudio)
set(SOURCES
${LADYBIRD_SOURCE_DIR}/UI/FontPlugin.cpp
${LADYBIRD_SOURCE_DIR}/UI/HelperProcess.cpp
${LADYBIRD_SOURCE_DIR}/UI/ImageCodecPlugin.cpp
${LADYBIRD_SOURCE_DIR}/UI/Utilities.cpp
ConnectionFromClient.cpp
ConsoleGlobalEnvironmentExtensions.cpp
@ -35,10 +32,6 @@ target_include_directories(webcontentservice PUBLIC $<BUILD_INTERFACE:${LADYBIRD
target_link_libraries(webcontentservice PUBLIC LibCore LibFileSystem LibGfx LibIPC LibJS LibMain LibMedia LibWeb LibWebSocket LibRequests LibWebView LibImageDecoderClient)
if (HAS_FONTCONFIG)
target_link_libraries(webcontentservice PRIVATE Fontconfig::Fontconfig)
endif()
if (ENABLE_QT)
qt_add_executable(WebContent main.cpp)
target_link_libraries(WebContent PRIVATE Qt::Core)
@ -61,11 +54,6 @@ endif()
target_link_libraries(WebContent PRIVATE webcontentservice LibURL)
target_sources(webcontentservice PUBLIC FILE_SET ladybird TYPE HEADERS
BASE_DIRS ${LADYBIRD_SOURCE_DIR}
FILES ${LADYBIRD_SOURCE_DIR}/UI/FontPlugin.h
${LADYBIRD_SOURCE_DIR}/UI/ImageCodecPlugin.h
)
target_sources(webcontentservice PUBLIC FILE_SET server TYPE HEADERS
BASE_DIRS ${LADYBIRD_SOURCE_DIR}/Services
FILES ConnectionFromClient.h

View file

@ -26,8 +26,8 @@
#include <LibWeb/PermissionsPolicy/AutoplayAllowlist.h>
#include <LibWeb/Platform/AudioCodecPluginAgnostic.h>
#include <LibWeb/Platform/EventLoopPluginSerenity.h>
#include <UI/FontPlugin.h>
#include <UI/ImageCodecPlugin.h>
#include <LibWebView/Plugins/FontPlugin.h>
#include <LibWebView/Plugins/ImageCodecPlugin.h>
#include <UI/Utilities.h>
#include <WebContent/ConnectionFromClient.h>
#include <WebContent/PageClient.h>
@ -169,7 +169,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
Web::HTML::Window::set_internals_object_exposed(expose_internals_object);
Web::Platform::FontPlugin::install(*new Ladybird::FontPlugin(is_layout_test_mode, &font_provider));
Web::Platform::FontPlugin::install(*new WebView::FontPlugin(is_layout_test_mode, &font_provider));
TRY(Web::Bindings::initialize_main_thread_vm(Web::HTML::EventLoop::Type::Window));
@ -277,7 +277,7 @@ ErrorOr<void> initialize_image_decoder(int image_decoder_socket)
auto new_client = TRY(try_make_ref_counted<ImageDecoderClient::Client>(IPC::Transport(move(socket))));
Web::Platform::ImageCodecPlugin::install(*new Ladybird::ImageCodecPlugin(move(new_client)));
Web::Platform::ImageCodecPlugin::install(*new WebView::ImageCodecPlugin(move(new_client)));
return {};
}
@ -291,7 +291,7 @@ ErrorOr<void> reinitialize_image_decoder(IPC::File const& image_decoder_socket)
auto new_client = TRY(try_make_ref_counted<ImageDecoderClient::Client>(IPC::Transport(move(socket))));
static_cast<Ladybird::ImageCodecPlugin&>(Web::Platform::ImageCodecPlugin::the()).set_client(move(new_client));
static_cast<WebView::ImageCodecPlugin&>(Web::Platform::ImageCodecPlugin::the()).set_client(move(new_client));
return {};
}