Truly independent web browser
WebContent: Move the worker code out of Services/WebWorker
Andreas Kling8c7a1769efaa
diff --git a/Libraries/LibWeb/HTML/SharedWorker.cpp b/Libraries/LibWeb/HTML/SharedWorker.cppindex fbfa684c1dc..6b7e2e03358 100644--- a/Libraries/LibWeb/HTML/SharedWorker.cpp+++ b/Libraries/LibWeb/HTML/SharedWorker.cpp@@ -77,7 +77,7 @@ WebIDL::ExceptionOr<GC::Ref<SharedWorker>> SharedWorker::create(WindowOrWorkerGl// 11. Enqueue the following steps to the shared worker manager:// The actual shared worker manager is owned by the UI process. It will either start a new- // WebWorker agent or transfer this port to an existing same-key SharedWorkerGlobalScope.+ // worker agent or transfer this port to an existing same-key SharedWorkerGlobalScope.run_a_worker(worker, worker->m_script_url, outside_settings, outside_port, worker->m_options);return worker;diff --git a/Libraries/LibWeb/HTML/Worker.cpp b/Libraries/LibWeb/HTML/Worker.cppindex 7e726235e34..b4b3a676e25 100644--- a/Libraries/LibWeb/HTML/Worker.cpp+++ b/Libraries/LibWeb/HTML/Worker.cpp@@ -56,7 +56,7 @@ WebIDL::ExceptionOr<GC::Ref<Worker>> Worker::create(WindowOrWorkerGlobalScopeMixTrustedTypes::InjectionSink::Worker_constructor,TrustedTypes::Script.view()));- dbgln_if(WEB_WORKER_DEBUG, "WebWorker: Creating worker with compliant_script_url = {}", compliant_script_url);+ dbgln_if(WEB_WORKER_DEBUG, "Worker: Creating worker with compliant_script_url = {}", compliant_script_url);// 2. Let outsideSettings be this's relevant settings object.auto& outside_settings = HTML::relevant_settings_object(global_scope);@@ -66,7 +66,7 @@ WebIDL::ExceptionOr<GC::Ref<Worker>> Worker::create(WindowOrWorkerGlobalScopeMix// 4. If workerURL is failure, then throw a "SyntaxError" DOMException.if (!worker_url.has_value()) {- dbgln_if(WEB_WORKER_DEBUG, "WebWorker: Invalid URL loaded '{}'.", compliant_script_url);+ dbgln_if(WEB_WORKER_DEBUG, "Worker: Invalid URL loaded '{}'.", compliant_script_url);return WebIDL::SyntaxError::create("url is not valid"_utf16);}@@ -151,7 +151,7 @@ WebIDL::ExceptionOr<void> Worker::terminate()// https://html.spec.whatwg.org/multipage/workers.html#dom-worker-postmessageWebIDL::ExceptionOr<void> Worker::post_message(JS::Realm& realm, JS::Value message, StructuredSerializeOptions const& options){- dbgln_if(WEB_WORKER_DEBUG, "WebWorker: Post Message: {}", message);+ dbgln_if(WEB_WORKER_DEBUG, "Worker: Post Message: {}", message);// The postMessage(message, transfer) and postMessage(message, options) methods on Worker objects act as if,// when invoked, they immediately invoked the respective postMessage(message, transfer) anddiff --git a/Libraries/LibWeb/HTML/WorkerAgentParent.cpp b/Libraries/LibWeb/HTML/WorkerAgentParent.cppindex 213bee9f59d..aff4adf5f54 100644--- a/Libraries/LibWeb/HTML/WorkerAgentParent.cpp+++ b/Libraries/LibWeb/HTML/WorkerAgentParent.cpp@@ -93,13 +93,13 @@ void WorkerAgentParent::start()auto data_holder = MUST(m_message_port->transfer_steps(realm));// FIXME: Specification says this supposed to happen in step 11 of onComplete handler defined in https://html.spec.whatwg.org/multipage/workers.html#run-a-worker- // but that would require introducing a new IPC message type to communicate this from WebWorker to WebContent process,+ // but that would require introducing a new IPC message type to communicate this from the worker to its owner,// so let's do it here for now.m_outside_port->enable();auto serialized_outside_settings = m_outside_settings->serialize();- // The worker process has no display connection of its own, so capture the spawning page's+ // A worker has no display connection of its own, so capture the spawning page's// rendering rate to let the worker pace its rendering updates to match.auto maximum_frames_per_second = [&]() -> double {auto& global = m_outside_settings->global_object();@@ -128,7 +128,7 @@ void WorkerAgentParent::start().owner_token = m_owner_token,};- // NOTE: This blocking IPC call may launch another process.+ // NB: This blocking IPC call may launch another process.// If spinning the event loop for this can cause other javascript to execute, we're in trouble.worker_agent_parents().set(m_owner_token, *this);m_agent_id = Bindings::principal_host_defined_page(realm).client().start_worker_agent(move(request));@@ -237,8 +237,8 @@ void WorkerAgentParent::dispatch_worker_exception(Utf16String message, Utf16Stri}));}-// NB: The worker fetches its script with outside settings as the request's client, from a snapshot of it in the-// worker's process. The violations of its policies are reported here, where outside settings' global object is.+// NB: The worker fetches its script with outside settings as the request's client, from a snapshot of it on the+// worker's thread. The violations of its policies are reported here, where outside settings' global object is.void WorkerAgentParent::report_content_security_policy_violation(u64 policy_index, String effective_directive, URL::URL resource){// NB: A worker's script requests can violate only worker-src, and a module worker's json and text importsdiff --git a/Libraries/LibWeb/Loader/ResourceLoader.cpp b/Libraries/LibWeb/Loader/ResourceLoader.cppindex 9734b5d8710..0d75a017e9f 100644--- a/Libraries/LibWeb/Loader/ResourceLoader.cpp+++ b/Libraries/LibWeb/Loader/ResourceLoader.cpp@@ -630,7 +630,7 @@ RefPtr<Requests::Request> ResourceLoader::start_network_request(LoadRequest cons? Requests::RequestClient::CacheMissNotification::Yes: Requests::RequestClient::CacheMissNotification::No;// NB: Workers have a Page shim without a navigable or a browser page ID. Their- // requests are attributed through the worker process's browser-level owners.+ // requests are attributed through the worker's browser-level owners.auto originating_page_id = request.page() && request.page()->has_top_level_traversable() ? request.page()->client().id().value() : 0;auto headers = headers_with_normalized_values(request.headers());auto protocol_request = request_client->start_request(request.method(), request.url().value(), *headers, request.body(), request.cache_mode(), request.include_credentials(), transfer_lease, {}, cache_miss_notification, originating_page_id, request.network_isolation_key());diff --git a/Libraries/LibWeb/ServiceWorker/ServiceWorkerRecord.h b/Libraries/LibWeb/ServiceWorker/ServiceWorkerRecord.hindex a618461daee..9c7c09ddd5b 100644--- a/Libraries/LibWeb/ServiceWorker/ServiceWorkerRecord.h+++ b/Libraries/LibWeb/ServiceWorker/ServiceWorkerRecord.h@@ -16,7 +16,7 @@ namespace Web::ServiceWorker {// https://w3c.github.io/ServiceWorker/#dfn-service-worker// This class corresponds to "service worker", not "ServiceWorker"// FIXME: This should be owned and managed at the user agent level-// FIXME: A lot of the fields for this struct actually need to live in the Agent for the service worker in the WebWorker process+// FIXME: A lot of the fields for this struct actually need to live in the Agent for the service workerstruct ServiceWorkerRecord {// https://w3c.github.io/ServiceWorker/#dfn-state// A service worker has an associated state, which is one of "parsed", "installing", "installed", "activating", "activated", and "redundant". It is initially "parsed".diff --git a/Libraries/LibWeb/WebRTC/RTCRtpScriptTransform.cpp b/Libraries/LibWeb/WebRTC/RTCRtpScriptTransform.cppindex eba3dfb2629..38d9c225623 100644--- a/Libraries/LibWeb/WebRTC/RTCRtpScriptTransform.cpp+++ b/Libraries/LibWeb/WebRTC/RTCRtpScriptTransform.cpp@@ -65,7 +65,7 @@ WebIDL::ExceptionOr<GC::Ref<RTCRtpScriptTransform>> RTCRtpScriptTransform::const// 8.3. Fire an event named rtctransform using RTCTransformEvent on the transformer's// relevant global object.// IPC delivers serializedOptions verbatim to ConnectionFromClient::rtc_transform_init,- // which runs steps 8.1–8.3 in the worker process's realm.+ // which runs steps 8.1–8.3 in the worker's realm.static u64 next_transform_id = 1;transform->m_transform_id = next_transform_id++;auto agent = transform->m_worker ? transform->m_worker->agent() : nullptr;diff --git a/Libraries/LibWebCommon/CMakeLists.txt b/Libraries/LibWebCommon/CMakeLists.txtindex 801dbdb7875..aaa70cd25fd 100644--- a/Libraries/LibWebCommon/CMakeLists.txt+++ b/Libraries/LibWebCommon/CMakeLists.txt@@ -130,7 +130,6 @@ compile_ipc(WebDriver/BiDi.ipc WebDriver/BiDiCodecs.h)# both sides generate their endpoints from here.file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/Services/WebContent)file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/Services/WebDriver)-file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/Services/WebWorker)compile_ipc(${LADYBIRD_SOURCE_DIR}/Services/WebContent/WebContentClient.ipc ${CMAKE_BINARY_DIR}/Services/WebContent/WebContentClientEndpoint.h)compile_ipc(${LADYBIRD_SOURCE_DIR}/Services/WebContent/WebContentServer.ipc ${CMAKE_BINARY_DIR}/Services/WebContent/WebContentServerEndpoint.h)compile_ipc(${LADYBIRD_SOURCE_DIR}/Services/WebContent/WebContentTestClient.ipc ${CMAKE_BINARY_DIR}/Services/WebContent/WebContentTestClientEndpoint.h)@@ -139,8 +138,8 @@ compile_ipc(${LADYBIRD_SOURCE_DIR}/Services/WebDriver/WebDriverBrowserClient.ipccompile_ipc(${LADYBIRD_SOURCE_DIR}/Services/WebDriver/WebDriverBrowserServer.ipc ${CMAKE_BINARY_DIR}/Services/WebDriver/WebDriverBrowserServerEndpoint.h)compile_ipc(${LADYBIRD_SOURCE_DIR}/Services/WebContent/WebUIClient.ipc ${CMAKE_BINARY_DIR}/Services/WebContent/WebUIClientEndpoint.h)compile_ipc(${LADYBIRD_SOURCE_DIR}/Services/WebContent/WebUIServer.ipc ${CMAKE_BINARY_DIR}/Services/WebContent/WebUIServerEndpoint.h)-compile_ipc(${LADYBIRD_SOURCE_DIR}/Services/WebWorker/WebWorkerClient.ipc ${CMAKE_BINARY_DIR}/Services/WebWorker/WebWorkerClientEndpoint.h)-compile_ipc(${LADYBIRD_SOURCE_DIR}/Services/WebWorker/WebWorkerServer.ipc ${CMAKE_BINARY_DIR}/Services/WebWorker/WebWorkerServerEndpoint.h)+compile_ipc(${LADYBIRD_SOURCE_DIR}/Services/WebContent/WebWorkerClient.ipc ${CMAKE_BINARY_DIR}/Services/WebContent/WebWorkerClientEndpoint.h)+compile_ipc(${LADYBIRD_SOURCE_DIR}/Services/WebContent/WebWorkerServer.ipc ${CMAKE_BINARY_DIR}/Services/WebContent/WebWorkerServerEndpoint.h)set(GENERATED_SOURCESCSS/PropertyList.cpp@@ -151,8 +150,8 @@ set(GENERATED_SOURCES../../Services/WebContent/WebContentTestServerEndpoint.h../../Services/WebDriver/WebDriverBrowserClientEndpoint.h../../Services/WebDriver/WebDriverBrowserServerEndpoint.h- ../../Services/WebWorker/WebWorkerClientEndpoint.h- ../../Services/WebWorker/WebWorkerServerEndpoint.h+ ../../Services/WebContent/WebWorkerClientEndpoint.h+ ../../Services/WebContent/WebWorkerServerEndpoint.h../../Services/WebContent/WebUIClientEndpoint.h../../Services/WebContent/WebUIServerEndpoint.h)diff --git a/Libraries/LibWebView/Application.cpp b/Libraries/LibWebView/Application.cppindex dcd7897820f..1aef187e9c9 100644--- a/Libraries/LibWebView/Application.cpp+++ b/Libraries/LibWebView/Application.cpp@@ -1501,7 +1501,7 @@ ErrorOr<IPC::TransportHandle> Application::connect_new_compositor_canvas_client(return Error::from_string_literal("Compositor process is not available");// The Compositor treats every renderer-side connection uniformly; canvas-only- // clients (worker processes) simply never register navigable contexts, so the+ // clients (workers) simply never register navigable contexts, so the// returned connection id is not needed.auto response_or_error = m_compositor_client->try_connect_web_content();if (response_or_error.is_error())diff --git a/Libraries/LibWebView/HelperProcess.h b/Libraries/LibWebView/HelperProcess.hindex 642c63bdc5e..37c562ca485 100644--- a/Libraries/LibWebView/HelperProcess.h+++ b/Libraries/LibWebView/HelperProcess.h@@ -48,7 +48,7 @@ struct RequestServerClientConnection {// A new client of the session's RequestServer with no site. The client uses the cookies of the given session, which// must be the session of the process the client is for.WEBVIEW_API ErrorOr<RequestServerClientConnection> connect_new_request_server_client(BrowsingSession&, RequestServer::SiteBinding);-// Names a tab's mix in the AudioServer. Every renderer and worker process gets one of its own, and every process+// Names a tab's mix in the AudioServer. Every renderer and worker gets one of its own, and every process// that plays on its behalf plays into the same mix.WEBVIEW_API u64 allocate_audio_tab_id();// Launches the AudioServer for a renderer if it has none, keeping its controller connection in the given slot. Thediff --git a/Libraries/LibWebView/WebWorkerClient.h b/Libraries/LibWebView/WebWorkerClient.hindex 5f636c4d227..442c6135043 100644--- a/Libraries/LibWebView/WebWorkerClient.h+++ b/Libraries/LibWebView/WebWorkerClient.h@@ -21,8 +21,8 @@#include <LibWebView/BrowsingSession.h>#include <LibWebView/Export.h>#include <LibWebView/RequestServerSiteBindings.h>-#include <WebWorker/WebWorkerClientEndpoint.h>-#include <WebWorker/WebWorkerServerEndpoint.h>+#include <WebContent/WebWorkerClientEndpoint.h>+#include <WebContent/WebWorkerServerEndpoint.h>namespace WebView {diff --git a/Services/CMakeLists.txt b/Services/CMakeLists.txtindex 62432b0d32e..50d932929ba 100644--- a/Services/CMakeLists.txt+++ b/Services/CMakeLists.txt@@ -10,7 +10,6 @@ add_subdirectory(VideoDecoderServer)add_subdirectory(WebContent)add_subdirectory(WebDriver)add_subdirectory(WebRTCClient)-add_subdirectory(WebWorker)if (LINUX)foreach (helper IN LISTS ladybird_helper_processes)diff --git a/Services/WebContent/CMakeLists.txt b/Services/WebContent/CMakeLists.txtindex 4ac22ab2c66..f5759b8dd77 100644--- a/Services/WebContent/CMakeLists.txt+++ b/Services/WebContent/CMakeLists.txt@@ -12,6 +12,11 @@ set(SOURCESWebDriverBiDi.cppWebDriverConnection.cppWebUIConnection.cpp+ Worker/ConnectionFromClient.cpp+ Worker/PageHost.cpp+ Worker/WebWorkerCompositorHost.cpp+ Worker/WorkerHost.cpp+ Worker/WorkerThread.cpp)if (ANDROID)@@ -32,7 +37,7 @@ target_include_directories(webcontentservice PUBLIC $<BUILD_INTERFACE:${CMAKE_CUtarget_include_directories(webcontentservice PUBLIC $<BUILD_INTERFACE:${LADYBIRD_SOURCE_DIR}>)target_include_directories(webcontentservice PUBLIC $<BUILD_INTERFACE:${LADYBIRD_SOURCE_DIR}/Services/>)-target_link_libraries(webcontentservice PUBLIC LibCompositing LibCore LibCrypto LibDevTools LibFileSystem LibGfx LibHTTP LibIPC LibJS LibMain LibAudio LibMedia LibWeb LibRequests LibImageDecoderClient LibMediaClient LibGC webworkerservice)+target_link_libraries(webcontentservice PUBLIC LibCompositing LibCore LibCrypto LibDevTools LibFileSystem LibGfx LibHTTP LibIPC LibJS LibMain LibAudio LibMedia LibWeb LibRequests LibImageDecoderClient LibMediaClient LibGC LibThreading LibUnicode LibURL)target_link_libraries(webcontentservice PRIVATE OpenSSL::Crypto OpenSSL::SSL)target_compile_options(webcontentservice PRIVATE $<$<COMPILE_LANG_AND_ID:CXX,Clang,AppleClang>:-Wexit-time-destructors>)diff --git a/Services/WebContent/ConnectionFromClient.cpp b/Services/WebContent/ConnectionFromClient.cppindex 0e349ae49ab..928fd623756 100644--- a/Services/WebContent/ConnectionFromClient.cpp+++ b/Services/WebContent/ConnectionFromClient.cpp@@ -113,7 +113,7 @@#include <WebContent/WebContentClientEndpoint.h>#include <WebContent/WebContentCompositorHost.h>#include <WebContent/WebDriverBiDi.h>-#include <WebWorker/WorkerThread.h>+#include <WebContent/Worker/WorkerThread.h>namespace WebContent {diff --git a/Services/WebContent/PageClient.cpp b/Services/WebContent/PageClient.cppindex 0def3523a65..6b7ae363f22 100644--- a/Services/WebContent/PageClient.cpp+++ b/Services/WebContent/PageClient.cpp@@ -79,8 +79,8 @@#include <WebContent/TestConnection.h>#include <WebContent/WebContentClientEndpoint.h>#include <WebContent/WebDriverConnection.h>-#include <WebWorker/WorkerThread.h>#include <WebContent/WebUIConnection.h>+#include <WebContent/Worker/WorkerThread.h>namespace WebContent {diff --git a/Services/WebWorker/WebWorkerClient.ipc b/Services/WebContent/WebWorkerClient.ipcsimilarity index 100%rename from Services/WebWorker/WebWorkerClient.ipcrename to Services/WebContent/WebWorkerClient.ipcdiff --git a/Services/WebWorker/WebWorkerServer.ipc b/Services/WebContent/WebWorkerServer.ipcsimilarity index 100%rename from Services/WebWorker/WebWorkerServer.ipcrename to Services/WebContent/WebWorkerServer.ipcdiff --git a/Services/WebWorker/ConnectionFromClient.cpp b/Services/WebContent/Worker/ConnectionFromClient.cppsimilarity index 99%rename from Services/WebWorker/ConnectionFromClient.cpprename to Services/WebContent/Worker/ConnectionFromClient.cppindex 65d997cea42..e7400f12294 100644--- a/Services/WebWorker/ConnectionFromClient.cpp+++ b/Services/WebContent/Worker/ConnectionFromClient.cpp@@ -7,7 +7,6 @@#include <AK/Debug.h>#include <LibCompositing/FontServiceClient.h>#include <LibCore/EventLoop.h>-#include <LibCore/Process.h>#include <LibGC/Function.h>#include <LibImageDecoderClient/Client.h>#include <LibJS/Runtime/ArrayBuffer.h>@@ -39,10 +38,10 @@#include <LibWeb/WebRTC/RTCEncodedAudioFrame.h>#include <LibWeb/WebRTC/RTCRtpScriptTransformer.h>#include <LibWeb/WebRTC/RTCTransformEvent.h>-#include <WebWorker/ConnectionFromClient.h>-#include <WebWorker/PageHost.h>-#include <WebWorker/WorkerHost.h>-#include <WebWorker/WorkerThread.h>+#include <WebContent/Worker/ConnectionFromClient.h>+#include <WebContent/Worker/PageHost.h>+#include <WebContent/Worker/WorkerHost.h>+#include <WebContent/Worker/WorkerThread.h>namespace WebWorker {diff --git a/Services/WebWorker/ConnectionFromClient.h b/Services/WebContent/Worker/ConnectionFromClient.hsimilarity index 96%rename from Services/WebWorker/ConnectionFromClient.hrename to Services/WebContent/Worker/ConnectionFromClient.hindex a6304a96476..5e5eb8e9735 100644--- a/Services/WebWorker/ConnectionFromClient.h+++ b/Services/WebContent/Worker/ConnectionFromClient.h@@ -19,10 +19,10 @@#include <LibWebCommon/Forward.h>#include <LibWebCommon/HTML/BroadcastChannelMessage.h>#include <LibWebCommon/HTML/WorkerAgentTypes.h>-#include <WebWorker/Forward.h>-#include <WebWorker/PageHost.h>-#include <WebWorker/WebWorkerClientEndpoint.h>-#include <WebWorker/WebWorkerServerEndpoint.h>+#include <WebContent/WebWorkerClientEndpoint.h>+#include <WebContent/WebWorkerServerEndpoint.h>+#include <WebContent/Worker/Forward.h>+#include <WebContent/Worker/PageHost.h>namespace WebWorker {diff --git a/Services/WebWorker/Forward.h b/Services/WebContent/Worker/Forward.hsimilarity index 100%rename from Services/WebWorker/Forward.hrename to Services/WebContent/Worker/Forward.hdiff --git a/Services/WebWorker/PageHost.cpp b/Services/WebContent/Worker/PageHost.cppsimilarity index 95%rename from Services/WebWorker/PageHost.cpprename to Services/WebContent/Worker/PageHost.cppindex a8f4013aefe..e94148ef6a8 100644--- a/Services/WebWorker/PageHost.cpp+++ b/Services/WebContent/Worker/PageHost.cpp@@ -6,10 +6,10 @@#include <LibGC/Heap.h>#include <LibWebCommon/HTML/WorkerAgentTypes.h>-#include <WebWorker/ConnectionFromClient.h>-#include <WebWorker/PageHost.h>-#include <WebWorker/WebWorkerCompositorHost.h>-#include <WebWorker/WorkerThread.h>+#include <WebContent/Worker/ConnectionFromClient.h>+#include <WebContent/Worker/PageHost.h>+#include <WebContent/Worker/WebWorkerCompositorHost.h>+#include <WebContent/Worker/WorkerThread.h>namespace WebWorker {@@ -89,7 +89,7 @@ Web::CSS::PreferredMotion PageHost::preferred_motion() constreturn Web::CSS::PreferredMotion::Auto;}-// NB: A worker process hosts one environment, which the UI process knows to be the requesting one.+// NB: A worker's connection stands for one environment, which the UI process knows to be the requesting one.Optional<Web::Permissions::PermissionSnapshot> PageHost::page_did_request_permission_snapshot(URL::Origin const& top_level_origin){auto response = m_client.send_sync_but_allow_failure<Messages::WebWorkerClient::DidRequestPermissionSnapshot>(top_level_origin);diff --git a/Services/WebWorker/PageHost.h b/Services/WebContent/Worker/PageHost.hsimilarity index 99%rename from Services/WebWorker/PageHost.hrename to Services/WebContent/Worker/PageHost.hindex c38500040ac..7acf1bc7e96 100644--- a/Services/WebWorker/PageHost.h+++ b/Services/WebContent/Worker/PageHost.h@@ -12,7 +12,7 @@#include <LibWebCommon/Page/PageId.h>#include <LibWebCommon/Page/QueuedInputEvent.h>#include <LibWebCommon/PixelUnits.h>-#include <WebWorker/Forward.h>+#include <WebContent/Worker/Forward.h>namespace WebWorker {diff --git a/Services/WebWorker/WebWorkerCompositorHost.cpp b/Services/WebContent/Worker/WebWorkerCompositorHost.cppsimilarity index 87%rename from Services/WebWorker/WebWorkerCompositorHost.cpprename to Services/WebContent/Worker/WebWorkerCompositorHost.cppindex a5ace28f659..107f532e90b 100644--- a/Services/WebWorker/WebWorkerCompositorHost.cpp+++ b/Services/WebContent/Worker/WebWorkerCompositorHost.cpp@@ -5,8 +5,8 @@*/#include <LibWeb/Compositor/CompositorHost.h>-#include <WebWorker/ConnectionFromClient.h>-#include <WebWorker/WebWorkerCompositorHost.h>+#include <WebContent/Worker/ConnectionFromClient.h>+#include <WebContent/Worker/WebWorkerCompositorHost.h>namespace WebWorker {diff --git a/Services/WebWorker/WebWorkerCompositorHost.h b/Services/WebContent/Worker/WebWorkerCompositorHost.hsimilarity index 89%rename from Services/WebWorker/WebWorkerCompositorHost.hrename to Services/WebContent/Worker/WebWorkerCompositorHost.hindex d6778df0497..302e9be5a2e 100644--- a/Services/WebWorker/WebWorkerCompositorHost.h+++ b/Services/WebContent/Worker/WebWorkerCompositorHost.h@@ -8,7 +8,7 @@#include <AK/NonnullOwnPtr.h>#include <LibWeb/Compositor/CompositorHost.h>-#include <WebWorker/Forward.h>+#include <WebContent/Worker/Forward.h>namespace WebWorker {diff --git a/Services/WebWorker/WorkerHost.cpp b/Services/WebContent/Worker/WorkerHost.cppsimilarity index 99%rename from Services/WebWorker/WorkerHost.cpprename to Services/WebContent/Worker/WorkerHost.cppindex 4ab9901a832..7ef65f7e090 100644--- a/Services/WebWorker/WorkerHost.cpp+++ b/Services/WebContent/Worker/WorkerHost.cpp@@ -32,8 +32,8 @@#include <LibWeb/HTML/WorkerGlobalScope.h>#include <LibWeb/HighResolutionTime/TimeOrigin.h>#include <LibWeb/Loader/ResourceLoader.h>-#include <WebWorker/PageHost.h>-#include <WebWorker/WorkerHost.h>+#include <WebContent/Worker/PageHost.h>+#include <WebContent/Worker/WorkerHost.h>namespace WebWorker {diff --git a/Services/WebWorker/WorkerHost.h b/Services/WebContent/Worker/WorkerHost.hsimilarity index 97%rename from Services/WebWorker/WorkerHost.hrename to Services/WebContent/Worker/WorkerHost.hindex baa605a0afb..fff44676191 100644--- a/Services/WebWorker/WorkerHost.h+++ b/Services/WebContent/Worker/WorkerHost.h@@ -67,7 +67,7 @@ private:Utf16String m_name;bool m_is_shared { false };bool m_accepting_shared_worker_connections { false };- // WorkerHost is only touched on the WebWorker main thread.+ // WorkerHost is only touched on the worker's thread.Vector<PendingSharedWorkerConnection> m_pending_shared_worker_connections;bool m_script_has_run { false };diff --git a/Services/WebWorker/WorkerThread.cpp b/Services/WebContent/Worker/WorkerThread.cppsimilarity index 96%rename from Services/WebWorker/WorkerThread.cpprename to Services/WebContent/Worker/WorkerThread.cppindex 8375c2ddad2..2263c5f6112 100644--- a/Services/WebWorker/WorkerThread.cpp+++ b/Services/WebContent/Worker/WorkerThread.cpp@@ -14,8 +14,8 @@#include <LibJS/Runtime/VM.h>#include <LibThreading/Thread.h>#include <LibWeb/Bindings/MainThreadVM.h>-#include <WebWorker/ConnectionFromClient.h>-#include <WebWorker/WorkerThread.h>+#include <WebContent/Worker/ConnectionFromClient.h>+#include <WebContent/Worker/WorkerThread.h>namespace WebWorker {diff --git a/Services/WebWorker/WorkerThread.h b/Services/WebContent/Worker/WorkerThread.hsimilarity index 71%rename from Services/WebWorker/WorkerThread.hrename to Services/WebContent/Worker/WorkerThread.hindex 720468a9d48..1ed53ef3e5b 100644--- a/Services/WebWorker/WorkerThread.h+++ b/Services/WebContent/Worker/WorkerThread.h@@ -12,9 +12,9 @@namespace WebWorker {-// Starts a thread that hosts a worker agent, which talks to the UI process over the given transport as a worker process-// does. Nothing ever waits for the thread: it ends once its worker has closed, and otherwise with the process. A process-// that exits takes running workers with it, so it has to leave by Core::Process::terminate_immediately().+// Starts a thread that hosts a worker agent, which talks to the UI process over the given transport. Nothing ever waits+// for the thread: it ends once its worker has closed, and otherwise with the process. A process that exits takes running+// workers with it, so it has to leave by Core::Process::terminate_immediately().ErrorOr<void> start_worker_thread(IPC::TransportHandle, Web::HTML::AgentType);// Whether the calling thread is one start_worker_thread() started. This can be asked from a signal handler.diff --git a/Services/WebContent/main.cpp b/Services/WebContent/main.cppindex 0b2a7b580ab..ea129945bdc 100644--- a/Services/WebContent/main.cpp+++ b/Services/WebContent/main.cpp@@ -47,7 +47,7 @@#include <WebContent/PageClient.h>#include <WebContent/WebContentCompositorHost.h>#include <WebContent/WebDriverConnection.h>-#include <WebWorker/WorkerThread.h>+#include <WebContent/Worker/WorkerThread.h>#include <openssl/thread.h>diff --git a/Services/WebWorker/CMakeLists.txt b/Services/WebWorker/CMakeLists.txtdeleted file mode 100644index aa97389e862..00000000000--- a/Services/WebWorker/CMakeLists.txt+++ /dev/null@@ -1,20 +0,0 @@-set(WEBWORKER_SOURCES- ConnectionFromClient.cpp- PageHost.cpp- WebWorkerCompositorHost.cpp- WorkerHost.cpp- WorkerThread.cpp-)--# FIXME: Add Android service--add_library(webworkerservice STATIC ${WEBWORKER_SOURCES})-set_target_properties(webworkerservice PROPERTIES AUTOMOC OFF AUTORCC OFF AUTOUIC OFF)--target_include_directories(webworkerservice PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../..)-target_include_directories(webworkerservice PRIVATE ${LADYBIRD_SOURCE_DIR})-target_include_directories(webworkerservice PRIVATE ${LADYBIRD_SOURCE_DIR}/Services/)--target_link_libraries(webworkerservice PUBLIC LibCore LibFileSystem LibGfx LibHTTP LibIPC LibJS LibRequests LibCompositing LibWeb LibUnicode LibImageDecoderClient LibMain LibMediaClient LibThreading LibURL LibGC)-target_link_libraries(webworkerservice PRIVATE OpenSSL::Crypto OpenSSL::SSL)-diff --git a/Tests/LibWeb/test-web/TestRunCapture.h b/Tests/LibWeb/test-web/TestRunCapture.hindex c0b8a559995..ae2312eb4c2 100644--- a/Tests/LibWeb/test-web/TestRunCapture.h+++ b/Tests/LibWeb/test-web/TestRunCapture.h@@ -34,7 +34,7 @@ public:void write_test_output(TestWebView const&);bool write_helper_process_output();- // A worker's process goes away when no test is looking at it any more, so the run as a whole fails if one crashes.+ // A worker's thread goes away when no test is looking at it any more, so the run as a whole fails if one crashes.size_t crashed_worker_count() const { return m_crashed_worker_count; }TestRunCapture(TestRunCapture const&) = delete;