mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-22 02:09:24 +00:00
Ladybird+Userland: Remove use of unnecessary fd passing socket concept
Now that LibIPC is using SCM_RIGHTS properly, we can go back to only having one socket laying around when needing to transfer fds to peers.
This commit is contained in:
parent
cb87725ec8
commit
5e1d678bae
Notes:
sideshowbarker
2024-07-16 23:38:54 +09:00
Author: https://github.com/ADKaster
Commit: 5e1d678bae
Pull-request: https://github.com/SerenityOS/serenity/pull/24025
Issue: https://github.com/SerenityOS/serenity/issues/22357
Reviewed-by: https://github.com/trflynn89 ✅
32 changed files with 61 additions and 236 deletions
|
@ -9,7 +9,6 @@ set(SOURCES
|
|||
ProcessManager.cpp
|
||||
RequestServerAdapter.cpp
|
||||
SearchEngine.cpp
|
||||
SocketPair.cpp
|
||||
SourceHighlighter.cpp
|
||||
URL.cpp
|
||||
UserAgent.cpp
|
||||
|
|
|
@ -22,7 +22,6 @@ struct Attribute;
|
|||
struct CookieStorageKey;
|
||||
struct ProcessHandle;
|
||||
struct SearchEngine;
|
||||
struct SocketPair;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ OutOfProcessWebView::OutOfProcessWebView()
|
|||
|
||||
on_request_worker_agent = []() {
|
||||
auto worker_client = MUST(Web::HTML::WebWorkerClient::try_create());
|
||||
return worker_client->dup_sockets();
|
||||
return worker_client->dup_socket();
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2024, Andrew Kaster <akaster@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibIPC/Decoder.h>
|
||||
#include <LibIPC/Encoder.h>
|
||||
#include <LibWebView/SocketPair.h>
|
||||
|
||||
template<>
|
||||
ErrorOr<void> IPC::encode(Encoder& encoder, WebView::SocketPair const& pair)
|
||||
{
|
||||
TRY(encoder.encode(pair.socket));
|
||||
TRY(encoder.encode(pair.fd_passing_socket));
|
||||
return {};
|
||||
}
|
||||
|
||||
template<>
|
||||
ErrorOr<WebView::SocketPair> IPC::decode(Decoder& decoder)
|
||||
{
|
||||
auto socket = TRY(decoder.decode<IPC::File>());
|
||||
auto fd_passing_socket = TRY(decoder.decode<IPC::File>());
|
||||
|
||||
return WebView::SocketPair { move(socket), move(fd_passing_socket) };
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2024, Andrew Kaster <akaster@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LibIPC/File.h>
|
||||
|
||||
namespace WebView {
|
||||
|
||||
struct SocketPair {
|
||||
IPC::File socket;
|
||||
IPC::File fd_passing_socket;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
namespace IPC {
|
||||
|
||||
template<>
|
||||
ErrorOr<void> encode(Encoder&, WebView::SocketPair const&);
|
||||
|
||||
template<>
|
||||
ErrorOr<WebView::SocketPair> decode(Decoder&);
|
||||
|
||||
}
|
|
@ -200,7 +200,7 @@ public:
|
|||
Function<void(i32, size_t, Vector<Attribute> const&)> on_inspector_replaced_dom_node_attribute;
|
||||
Function<void(i32, Gfx::IntPoint, String const&, Optional<String> const&, Optional<size_t> const&)> on_inspector_requested_dom_tree_context_menu;
|
||||
Function<void(String const&)> on_inspector_executed_console_script;
|
||||
Function<SocketPair()> on_request_worker_agent;
|
||||
Function<IPC::File()> on_request_worker_agent;
|
||||
|
||||
virtual Web::DevicePixelRect viewport_rect() const = 0;
|
||||
virtual Gfx::IntPoint to_content_position(Gfx::IntPoint widget_position) const = 0;
|
||||
|
|
|
@ -665,7 +665,7 @@ Messages::WebContentClient::RequestWorkerAgentResponse WebContentClient::request
|
|||
return view->on_request_worker_agent();
|
||||
}
|
||||
|
||||
return WebView::SocketPair { IPC::File {}, IPC::File {} };
|
||||
return IPC::File {};
|
||||
}
|
||||
|
||||
Optional<ViewImplementation&> WebContentClient::view_for_page_id(u64 page_id, SourceLocation location)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue