mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-03 08:08:43 +00:00
Everywhere: Hoist the Libraries folder to the top-level
This commit is contained in:
parent
950e819ee7
commit
93712b24bf
Notes:
github-actions[bot]
2024-11-10 11:51:52 +00:00
Author: https://github.com/trflynn89
Commit: 93712b24bf
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2256
Reviewed-by: https://github.com/sideshowbarker
4547 changed files with 104 additions and 113 deletions
69
Libraries/LibWebView/ChromeProcess.h
Normal file
69
Libraries/LibWebView/ChromeProcess.h
Normal file
|
@ -0,0 +1,69 @@
|
|||
/*
|
||||
* Copyright (c) 2024, Andrew Kaster <akaster@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Error.h>
|
||||
#include <AK/Function.h>
|
||||
#include <AK/OwnPtr.h>
|
||||
#include <AK/Types.h>
|
||||
#include <LibIPC/ConnectionFromClient.h>
|
||||
#include <LibIPC/Forward.h>
|
||||
#include <LibIPC/MultiServer.h>
|
||||
#include <LibWebView/Options.h>
|
||||
#include <LibWebView/UIProcessClientEndpoint.h>
|
||||
#include <LibWebView/UIProcessServerEndpoint.h>
|
||||
|
||||
namespace WebView {
|
||||
|
||||
class UIProcessConnectionFromClient final
|
||||
: public IPC::ConnectionFromClient<UIProcessClientEndpoint, UIProcessServerEndpoint> {
|
||||
C_OBJECT(UIProcessConnectionFromClient);
|
||||
|
||||
public:
|
||||
virtual ~UIProcessConnectionFromClient() override = default;
|
||||
|
||||
virtual void die() override;
|
||||
|
||||
Function<void(Vector<URL::URL> const&)> on_new_tab;
|
||||
Function<void(Vector<URL::URL> const&)> on_new_window;
|
||||
|
||||
private:
|
||||
UIProcessConnectionFromClient(IPC::Transport, int client_id);
|
||||
|
||||
virtual void create_new_tab(Vector<ByteString> const& urls) override;
|
||||
virtual void create_new_window(Vector<ByteString> const& urls) override;
|
||||
};
|
||||
|
||||
class ChromeProcess {
|
||||
AK_MAKE_NONCOPYABLE(ChromeProcess);
|
||||
AK_MAKE_DEFAULT_MOVABLE(ChromeProcess);
|
||||
|
||||
public:
|
||||
enum class ProcessDisposition : u8 {
|
||||
ContinueMainProcess,
|
||||
ExitProcess,
|
||||
};
|
||||
|
||||
ChromeProcess() = default;
|
||||
~ChromeProcess();
|
||||
|
||||
ErrorOr<ProcessDisposition> connect(Vector<ByteString> const& raw_urls, NewWindow new_window);
|
||||
|
||||
Function<void(Vector<URL::URL> const&)> on_new_tab;
|
||||
Function<void(Vector<URL::URL> const&)> on_new_window;
|
||||
|
||||
private:
|
||||
ErrorOr<void> connect_as_client(ByteString const& socket_path, Vector<ByteString> const& raw_urls, NewWindow new_window);
|
||||
ErrorOr<void> connect_as_server(ByteString const& socket_path);
|
||||
|
||||
OwnPtr<IPC::MultiServer<UIProcessConnectionFromClient>> m_server_connection;
|
||||
OwnPtr<Core::File> m_pid_file;
|
||||
ByteString m_pid_path;
|
||||
ByteString m_socket_path;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue