mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 04:27:45 +00:00
LibWeb+WebContent: Spawn Worker processes from the chrome
Instead of spawning these processes from the WebContent process, we now create them in the Browser chrome. Part 1/N of "all processes are owned by the chrome".
This commit is contained in:
parent
6ea4c248ab
commit
02edd240ae
26 changed files with 152 additions and 99 deletions
|
@ -21,6 +21,7 @@
|
|||
#include <LibWeb/Painting/ViewportPaintable.h>
|
||||
#include <LibWeb/Platform/Timer.h>
|
||||
#include <LibWebView/Attribute.h>
|
||||
#include <LibWebView/SocketPair.h>
|
||||
#include <WebContent/ConnectionFromClient.h>
|
||||
#include <WebContent/PageClient.h>
|
||||
#include <WebContent/PageHost.h>
|
||||
|
@ -561,6 +562,17 @@ void PageClient::page_did_insert_clipboard_entry(String data, String presentatio
|
|||
client().async_did_insert_clipboard_entry(move(data), move(presentation_style), move(mime_type));
|
||||
}
|
||||
|
||||
WebView::SocketPair PageClient::request_worker_agent()
|
||||
{
|
||||
auto response = client().send_sync_but_allow_failure<Messages::WebContentClient::RequestWorkerAgent>();
|
||||
if (!response) {
|
||||
dbgln("WebContent client disconnected during RequestWorkerAgent. Exiting peacefully.");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
return response->take_sockets();
|
||||
}
|
||||
|
||||
void PageClient::inspector_did_load()
|
||||
{
|
||||
client().async_inspector_did_load();
|
||||
|
|
|
@ -128,6 +128,7 @@ private:
|
|||
virtual void page_did_finish_text_test() override;
|
||||
virtual void page_did_change_theme_color(Gfx::Color color) override;
|
||||
virtual void page_did_insert_clipboard_entry(String data, String presentation_style, String mime_type) override;
|
||||
virtual WebView::SocketPair request_worker_agent() override;
|
||||
virtual void inspector_did_load() override;
|
||||
virtual void inspector_did_select_dom_node(i32 node_id, Optional<Web::CSS::Selector::PseudoElement::Type> const& pseudo_element) override;
|
||||
virtual void inspector_did_set_dom_node_text(i32 node_id, String const& text) override;
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include <LibWeb/HTML/SelectItem.h>
|
||||
#include <LibWeb/Page/Page.h>
|
||||
#include <LibWebView/Attribute.h>
|
||||
#include <LibWebView/SocketPair.h>
|
||||
|
||||
endpoint WebContentClient
|
||||
{
|
||||
|
@ -78,6 +79,8 @@ endpoint WebContentClient
|
|||
|
||||
did_finish_text_test() =|
|
||||
|
||||
request_worker_agent() => (WebView::SocketPair sockets) // FIXME: Add required attributes to select a SharedWorker Agent
|
||||
|
||||
inspector_did_load() =|
|
||||
inspector_did_select_dom_node(i32 node_id, Optional<Web::CSS::Selector::PseudoElement::Type> pseudo_element) =|
|
||||
inspector_did_set_dom_node_text(i32 node_id, String text) =|
|
||||
|
|
|
@ -41,7 +41,6 @@ ErrorOr<int> serenity_main(Main::Arguments)
|
|||
TRY(Core::System::unveil("/tmp/session/%sid/portal/request", "rw"));
|
||||
TRY(Core::System::unveil("/tmp/session/%sid/portal/image", "rw"));
|
||||
TRY(Core::System::unveil("/tmp/session/%sid/portal/websocket", "rw"));
|
||||
TRY(Core::System::unveil("/tmp/session/%sid/portal/webworker", "rw"));
|
||||
TRY(Core::System::unveil(nullptr, nullptr));
|
||||
|
||||
Web::Platform::EventLoopPlugin::install(*new Web::Platform::EventLoopPluginSerenity);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue