mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
Previously, the LibWeb bindings generator would output multiple per interface files like Prototype/Constructor/Namespace/GlobalMixin depending on the contents of that IDL file. This complicates the build system as it means that it does not know what files will be generated without knowledge of the contents of that IDL file. Instead, for each IDL file only generate a single Bindings/<IDLFile>.h and Bindings/<IDLFile>.cpp.
49 lines
1.5 KiB
C++
49 lines
1.5 KiB
C++
/*
|
|
* Copyright (c) 2023, Andrew Kaster <akaster@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibURL/URL.h>
|
|
#include <LibWeb/Bindings/AgentType.h>
|
|
#include <LibWeb/Bindings/Request.h>
|
|
#include <LibWeb/Bindings/Worker.h>
|
|
#include <LibWeb/Forward.h>
|
|
|
|
namespace Web::HTML {
|
|
|
|
struct WorkerOptions {
|
|
String name { String {} };
|
|
Bindings::WorkerType type { Bindings::WorkerType::Classic };
|
|
Bindings::RequestCredentials credentials { Bindings::RequestCredentials::SameOrigin };
|
|
};
|
|
|
|
// FIXME: Figure out a better naming convention for this type of parent/child process pattern.
|
|
class WorkerAgentParent : public JS::Cell {
|
|
GC_CELL(WorkerAgentParent, JS::Cell);
|
|
GC_DECLARE_ALLOCATOR(WorkerAgentParent);
|
|
|
|
protected:
|
|
WorkerAgentParent(URL::URL url, WorkerOptions const& options, GC::Ptr<MessagePort> outside_port, GC::Ref<EnvironmentSettingsObject> outside_settings, GC::Ref<DOM::EventTarget> worker_event_target, Bindings::AgentType);
|
|
virtual void initialize(JS::Realm&) override;
|
|
virtual void visit_edges(Cell::Visitor&) override;
|
|
|
|
private:
|
|
void setup_worker_ipc_callbacks(JS::Realm&);
|
|
|
|
WorkerOptions m_worker_options;
|
|
Bindings::AgentType m_agent_type { Bindings::AgentType::DedicatedWorker };
|
|
URL::URL m_url;
|
|
|
|
GC::Ptr<MessagePort> m_message_port;
|
|
GC::Ptr<MessagePort> m_outside_port;
|
|
GC::Ref<EnvironmentSettingsObject> m_outside_settings;
|
|
GC::Ref<DOM::EventTarget> m_worker_event_target;
|
|
|
|
RefPtr<Web::HTML::WebWorkerClient> m_worker_ipc;
|
|
};
|
|
|
|
}
|