mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-05 16:41:52 +00:00
LibWeb+LibWebView+Services: Add IPC for starting WebWorker of a type
The provides some of the plumbing for a WebContent process to spin up a WebWorker that is not just a dedicated worker.
This commit is contained in:
parent
041ff0c7ff
commit
a2cca59516
Notes:
github-actions[bot]
2025-04-25 14:45:22 +00:00
Author: https://github.com/shannonbooth
Commit: a2cca59516
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4453
10 changed files with 49 additions and 13 deletions
|
@ -167,7 +167,7 @@ ErrorOr<NonnullRefPtr<ImageDecoderClient::Client>> launch_image_decoder_process(
|
|||
return launch_server_process<ImageDecoderClient::Client>("ImageDecoder"sv, arguments);
|
||||
}
|
||||
|
||||
ErrorOr<NonnullRefPtr<Web::HTML::WebWorkerClient>> launch_web_worker_process()
|
||||
ErrorOr<NonnullRefPtr<Web::HTML::WebWorkerClient>> launch_web_worker_process(Web::Bindings::AgentType type)
|
||||
{
|
||||
Vector<ByteString> arguments;
|
||||
|
||||
|
@ -179,6 +179,21 @@ ErrorOr<NonnullRefPtr<Web::HTML::WebWorkerClient>> launch_web_worker_process()
|
|||
arguments.append("--image-decoder-socket"sv);
|
||||
arguments.append(ByteString::number(image_decoder_socket.fd()));
|
||||
|
||||
arguments.append("--type"sv);
|
||||
switch (type) {
|
||||
case Web::Bindings::AgentType::DedicatedWorker:
|
||||
arguments.append("dedicated"sv);
|
||||
break;
|
||||
case Web::Bindings::AgentType::SharedWorker:
|
||||
arguments.append("shared"sv);
|
||||
break;
|
||||
case Web::Bindings::AgentType::ServiceWorker:
|
||||
arguments.append("service"sv);
|
||||
break;
|
||||
default:
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
return launch_server_process<Web::HTML::WebWorkerClient>("WebWorker"sv, move(arguments));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue