mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-03 09:48:47 +00:00
The implicit constructor for IPC::File does not take ownership of the file, which is surprising.
30 lines
819 B
C++
30 lines
819 B
C++
/*
|
|
* 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;
|
|
}
|
|
|
|
}
|