mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-21 01:40:46 +00:00
LibIPC+Everywhere: Introduce an IPC Transport abstraction
This abstraction will help us to support multiple IPC transport mechanisms going forward. For now, we only have a TransportSocket that implements the same behavior we previously had, using Unix Sockets for IPC.
This commit is contained in:
parent
9a6eccc590
commit
7372b2af48
Notes:
github-actions[bot]
2024-10-23 19:14:14 +00:00
Author: https://github.com/ADKaster
Commit: 7372b2af48
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1925
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/trflynn89
45 changed files with 415 additions and 234 deletions
|
@ -11,6 +11,7 @@
|
|||
#include <AK/Weakable.h>
|
||||
#include <LibCore/Socket.h>
|
||||
#include <LibIPC/File.h>
|
||||
#include <LibIPC/Transport.h>
|
||||
#include <LibWeb/Bindings/Transferable.h>
|
||||
#include <LibWeb/DOM/EventTarget.h>
|
||||
#include <LibWeb/Forward.h>
|
||||
|
@ -69,13 +70,13 @@ private:
|
|||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
bool is_entangled() const { return static_cast<bool>(m_socket); }
|
||||
bool is_entangled() const;
|
||||
|
||||
WebIDL::ExceptionOr<void> message_port_post_message_steps(JS::GCPtr<MessagePort> target_port, JS::Value message, StructuredSerializeOptions const& options);
|
||||
void post_message_task_steps(SerializedTransferRecord&);
|
||||
void post_port_message(SerializedTransferRecord);
|
||||
ErrorOr<void> send_message_on_socket(SerializedTransferRecord const&);
|
||||
void read_from_socket();
|
||||
ErrorOr<void> send_message_on_transport(SerializedTransferRecord const&);
|
||||
void read_from_transport();
|
||||
|
||||
enum class ParseDecision {
|
||||
NotEnoughData,
|
||||
|
@ -89,7 +90,7 @@ private:
|
|||
// https://html.spec.whatwg.org/multipage/web-messaging.html#has-been-shipped
|
||||
bool m_has_been_shipped { false };
|
||||
|
||||
OwnPtr<Core::LocalSocket> m_socket;
|
||||
Optional<IPC::Transport> m_transport;
|
||||
|
||||
enum class SocketState : u8 {
|
||||
Header,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue