1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 19:38:12 +00:00

Ladybird/WebDriver: Move to using local socket files for WebDriver IPC

This allows us to use standard Serenity IPC infrastructure rather than
manually creating FD-passing sockets. This also lets us use Serenity's
WebDriver Session class, removing the copy previously used in Ladybird.
This ensures any changes to Session in the future will be picked up by
Ladybird for free.
This commit is contained in:
Timothy Flynn 2022-12-15 09:18:52 -05:00 committed by Andrew Kaster
parent ea26e45594
commit e5192073d9
12 changed files with 95 additions and 231 deletions

View file

@ -20,7 +20,7 @@
extern DeprecatedString s_serenity_resource_root;
extern Browser::Settings* s_settings;
Tab::Tab(BrowserWindow* window, int webdriver_fd_passing_socket)
Tab::Tab(BrowserWindow* window, StringView webdriver_content_ipc_path)
: QWidget(window)
, m_window(window)
{
@ -28,7 +28,7 @@ Tab::Tab(BrowserWindow* window, int webdriver_fd_passing_socket)
m_layout->setSpacing(0);
m_layout->setContentsMargins(0, 0, 0, 0);
m_view = new WebContentView(webdriver_fd_passing_socket);
m_view = new WebContentView(webdriver_content_ipc_path);
m_toolbar = new QToolBar(this);
m_location_edit = new QLineEdit(this);
@ -151,7 +151,7 @@ Tab::Tab(BrowserWindow* window, int webdriver_fd_passing_socket)
//
// Note we *don't* do this if we are connected to a WebDriver, as the Set URL command may come in very
// quickly, and become replaced by this load.
if (webdriver_fd_passing_socket == -1) {
if (!webdriver_content_ipc_path.is_empty()) {
m_is_history_navigation = true;
m_view->load("about:blank"sv);
}