LibWeb/HTML: Hook up a WorkerAgent for web workers

This commit is contained in:
Shannon Booth 2025-04-24 15:22:25 +12:00 committed by Andreas Kling
parent 5290ebfe19
commit 041ff0c7ff
Notes: github-actions[bot] 2025-04-25 14:45:27 +00:00
10 changed files with 78 additions and 12 deletions

View file

@ -11,10 +11,12 @@
namespace Web::HTML {
NonnullOwnPtr<SimilarOriginWindowAgent> SimilarOriginWindowAgent::create()
NonnullOwnPtr<SimilarOriginWindowAgent> SimilarOriginWindowAgent::create(GC::Heap& heap)
{
// See 'creating an agent' step in: https://html.spec.whatwg.org/multipage/webappapis.html#obtain-similar-origin-window-agent
return adopt_own(*new SimilarOriginWindowAgent(CanBlock::No));
auto agent = adopt_own(*new SimilarOriginWindowAgent(CanBlock::No));
agent->event_loop = heap.allocate<HTML::EventLoop>(HTML::EventLoop::Type::Window);
return agent;
}
// https://html.spec.whatwg.org/multipage/webappapis.html#relevant-agent