forked from LadybirdBrowser/ladybird
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Wip: Wip lmao probably doesn't build
- Loading branch information
Showing
15 changed files
with
217 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Copyright (c) 2024, Andrew Kaster <akaster@serenityos.org> | ||
* | ||
* SPDX-License-Identifier: BSD-2-Clause | ||
*/ | ||
|
||
#include <LibWebView/Application.h> | ||
|
||
namespace WebView { | ||
|
||
Application* Application::s_the = nullptr; | ||
|
||
Application::Application(int, char**) | ||
{ | ||
VERIFY(!s_the); | ||
s_the = this; | ||
} | ||
|
||
Application::~Application() | ||
{ | ||
s_the = nullptr; | ||
} | ||
|
||
int Application::exec() | ||
{ | ||
return m_event_loop.exec(); | ||
} | ||
|
||
void Application::add_child_process(WebView::Process&& process) | ||
{ | ||
m_process_manager.add_process(move(process)); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright (c) 2024, Andrew Kaster <akaster@serenityos.org> | ||
* | ||
* SPDX-License-Identifier: BSD-2-Clause | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <LibCore/EventLoop.h> | ||
#include <LibWebView/Process.h> | ||
|
||
namespace WebView { | ||
|
||
class Application { | ||
AK_MAKE_NONCOPYABLE(Application); | ||
|
||
public: | ||
Application(int argc, char** argv); | ||
virtual ~Application(); | ||
|
||
int exec(); | ||
|
||
static Application& the() { return *s_the; } | ||
|
||
Core::EventLoop& event_loop() { return m_event_loop; } | ||
|
||
void add_child_process(Process&&); | ||
|
||
protected: | ||
virtual void process_did_exit(Process const&) = 0; | ||
|
||
private: | ||
static Application* s_the; | ||
|
||
Core::EventLoop m_event_loop; | ||
|
||
Optional<Process&> m_request_server_process; | ||
Optional<Process&> m_image_decoder_process; | ||
|
||
ProcessManager m_process_manager; | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* Copyright (c) 2024, Andrew Kaster <akaster@serenityos.org> | ||
* | ||
* SPDX-License-Identifier: BSD-2-Clause | ||
*/ | ||
|
||
#include <LibCore/Process.h> | ||
#include <LibWebView/Process.h> | ||
|
||
namespace WebView { | ||
|
||
Process::Process(ProcessType type, RefPtr<IPC::ConnectionBase> connection, Core::Process process) | ||
: m_process(move(process)) | ||
, m_type(type) | ||
, m_connection(move(connection)) | ||
{ | ||
} | ||
|
||
Process::~Process() | ||
{ | ||
m_connection->shutdown(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright (c) 2024, Andrew Kaster <akaster@serenityos.org> | ||
* | ||
* SPDX-License-Identifier: BSD-2-Clause | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <LibCore/Process.h> | ||
#include <LibIPC/Connection.h> | ||
#include <LibWebView/ProcessManager.h> | ||
#include <LibWebView/ProcessType.h> | ||
|
||
namespace WebView { | ||
|
||
class Process { | ||
AK_MAKE_NONCOPYABLE(Process); | ||
AK_MAKE_DEFAULT_MOVABLE(Process); | ||
|
||
public: | ||
Process(ProcessType type, RefPtr<IPC::ConnectionBase> connection, Core::Process process); | ||
~Process(); | ||
|
||
ProcessType type() const { return m_type; } | ||
Optional<String> const& title() const { return m_title; } | ||
void set_title(String title) { m_title = move(title); } | ||
|
||
template<typename ConnectionFromClient> | ||
ConnectionFromClient& client() | ||
{ | ||
return verify_cast<ConnectionFromClient>(*m_connection); | ||
} | ||
|
||
pid_t pid() const { return m_process.pid(); } | ||
|
||
private: | ||
Core::Process m_process; | ||
ProcessType m_type; | ||
Optional<String> m_title; | ||
RefPtr<IPC::ConnectionBase> m_connection; | ||
}; | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.