2023-11-08 15:47:41 -03:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2023, Andrew Kaster <akaster@serenityos.org>
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <LibIPC/ConnectionToServer.h>
|
2025-09-07 11:32:43 -03:00
|
|
|
#include <LibWeb/Cookie/Cookie.h>
|
2025-07-19 23:35:33 -03:00
|
|
|
#include <LibWeb/Export.h>
|
2023-11-08 15:47:41 -03:00
|
|
|
#include <LibWeb/Worker/WebWorkerClientEndpoint.h>
|
|
|
|
|
#include <LibWeb/Worker/WebWorkerServerEndpoint.h>
|
|
|
|
|
|
|
|
|
|
namespace Web::HTML {
|
|
|
|
|
|
2025-07-19 23:35:33 -03:00
|
|
|
class WEB_API WebWorkerClient final
|
2023-11-08 15:47:41 -03:00
|
|
|
: public IPC::ConnectionToServer<WebWorkerClientEndpoint, WebWorkerServerEndpoint>
|
|
|
|
|
, public WebWorkerClientEndpoint {
|
2024-11-21 16:46:45 -03:00
|
|
|
C_OBJECT_ABSTRACT(WebWorkerClient);
|
2023-11-08 15:47:41 -03:00
|
|
|
|
|
|
|
|
public:
|
2025-04-08 17:01:46 -03:00
|
|
|
explicit WebWorkerClient(NonnullOwnPtr<IPC::Transport>);
|
2023-11-08 15:47:41 -03:00
|
|
|
|
2024-07-09 06:00:06 -03:00
|
|
|
virtual void did_close_worker() override;
|
2025-09-07 11:32:43 -03:00
|
|
|
virtual Messages::WebWorkerClient::DidRequestCookieResponse did_request_cookie(URL::URL, Cookie::Source) override;
|
2024-07-09 06:00:06 -03:00
|
|
|
|
|
|
|
|
Function<void()> on_worker_close;
|
2025-09-07 11:32:43 -03:00
|
|
|
Function<String(URL::URL const&, Cookie::Source)> on_request_cookie;
|
2024-07-09 06:00:06 -03:00
|
|
|
|
2024-10-22 18:47:33 -03:00
|
|
|
IPC::File clone_transport();
|
2024-01-06 17:13:59 -03:00
|
|
|
|
2023-11-08 15:47:41 -03:00
|
|
|
private:
|
|
|
|
|
virtual void die() override;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|