ladybird/Userland/Libraries/LibWeb/Worker/WebWorkerClient.cpp

31 lines
819 B
C++
Raw Normal View History

/*
* Copyright (c) 2023, Andrew Kaster <akaster@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibCore/System.h>
#include <LibWeb/Worker/WebWorkerClient.h>
namespace Web::HTML {
void WebWorkerClient::die()
{
// FIXME: Notify WorkerAgent that the worker is ded
}
WebWorkerClient::WebWorkerClient(NonnullOwnPtr<Core::LocalSocket> socket)
: IPC::ConnectionToServer<WebWorkerClientEndpoint, WebWorkerServerEndpoint>(*this, move(socket))
{
}
WebView::SocketPair WebWorkerClient::dup_sockets()
{
WebView::SocketPair pair;
pair.socket = IPC::File(MUST(Core::System::dup(socket().fd().value())), IPC::File::CloseAfterSending);
pair.fd_passing_socket = IPC::File(MUST(Core::System::dup(fd_passing_socket().fd().value())), IPC::File::CloseAfterSending);
return pair;
}
}