1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 09:48:11 +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:
Andrew Kaster 2024-01-06 13:13:59 -07:00 committed by Andrew Kaster
parent 6ea4c248ab
commit 02edd240ae
26 changed files with 152 additions and 99 deletions

View file

@ -6,12 +6,8 @@
#pragma once
#include <LibCore/Socket.h>
#include <LibWeb/Forward.h>
#include <LibWeb/HTML/MessageEvent.h>
#include <LibWeb/HTML/MessagePort.h>
#include <LibWeb/HTML/Scripting/WorkerEnvironmentSettingsObject.h>
#include <LibWeb/HTML/Window.h>
#include <LibWeb/Worker/WebWorkerClient.h>
namespace Web::HTML {
@ -22,14 +18,12 @@ struct WorkerOptions {
String name { String {} };
};
struct WorkerAgent : JS::Cell {
class WorkerAgent : public JS::Cell {
JS_CELL(Agent, JS::Cell);
JS_DECLARE_ALLOCATOR(WorkerAgent);
WorkerAgent(AK::URL url, WorkerOptions const& options, JS::GCPtr<MessagePort> outside_port);
RefPtr<Web::HTML::WebWorkerClient> m_worker_ipc;
private:
virtual void initialize(JS::Realm&) override;
virtual void visit_edges(Cell::Visitor&) override;
@ -39,6 +33,8 @@ private:
JS::GCPtr<MessagePort> m_message_port;
JS::GCPtr<MessagePort> m_outside_port;
RefPtr<Web::HTML::WebWorkerClient> m_worker_ipc;
};
}