mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 02:07:34 +00:00
Ladybird: Render web content in a separate process :^)
This patch brings over the WebContent process over from SerenityOS to Ladybird, along with a new WebContentView widget that renders web content in a separate process. There's a lot of jank and FIXME material here, notably I had to re-add manually pumped Core::EventLoop instances on both sides, in order to get the IPC protocol running. This introduces a lot of latency and we should work towards replacing those loops with improved abstractions. The WebContent process is built separately here (not part of Lagom) and we provide our own main.cpp for it. Like everything, this can be better architected, it's just a starting point. :^)
This commit is contained in:
parent
2451a447f5
commit
26a7ea0e0f
14 changed files with 1313 additions and 795 deletions
|
@ -7,6 +7,12 @@
|
|||
#define AK_DONT_REPLACE_STD
|
||||
|
||||
#include "Utilities.h"
|
||||
#include <AK/LexicalPath.h>
|
||||
#include <AK/Platform.h>
|
||||
#include <LibCore/File.h>
|
||||
#include <QCoreApplication>
|
||||
|
||||
String s_serenity_resource_root;
|
||||
|
||||
AK::String akstring_from_qstring(QString const& qstring)
|
||||
{
|
||||
|
@ -17,3 +23,25 @@ QString qstring_from_akstring(AK::String const& akstring)
|
|||
{
|
||||
return QString::fromUtf8(akstring.characters(), akstring.length());
|
||||
}
|
||||
|
||||
void platform_init()
|
||||
{
|
||||
#ifdef AK_OS_ANDROID
|
||||
extern void android_platform_init();
|
||||
android_platform_init();
|
||||
#else
|
||||
s_serenity_resource_root = [] {
|
||||
auto const* source_dir = getenv("SERENITY_SOURCE_DIR");
|
||||
if (source_dir) {
|
||||
return String::formatted("{}/Base", source_dir);
|
||||
}
|
||||
auto* home = getenv("XDG_CONFIG_HOME") ?: getenv("HOME");
|
||||
VERIFY(home);
|
||||
auto home_lagom = String::formatted("{}/.lagom", home);
|
||||
if (Core::File::is_directory(home_lagom))
|
||||
return home_lagom;
|
||||
auto app_dir = akstring_from_qstring(QCoreApplication::applicationDirPath());
|
||||
return LexicalPath(app_dir).parent().append("share"sv).string();
|
||||
}();
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue