1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-08 13:37:10 +09:00
ladybird/Libraries/LibWeb/HTML/Scripting/Agent.h
Shannon Booth 5290ebfe19 LibJS: Switch Agent [[CanBlock]] slot to a enum member
It turns out it was a mistake to make this a virtual since
ServiceWorkerAgents are effectively the exact same as
DedicatedWorkerAgents and SharedWorkerAgents just with [[CanBlock]]
set to false.
2025-04-25 14:07:51 +02:00

31 lines
902 B
C++

/*
* Copyright (c) 2025, Shannon Booth <shannon@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibGC/Root.h>
#include <LibJS/Forward.h>
#include <LibJS/Runtime/Agent.h>
#include <LibWeb/Forward.h>
namespace Web::HTML {
struct Agent : public JS::Agent {
// https://html.spec.whatwg.org/multipage/webappapis.html#window-event-loop
// The event loop of a similar-origin window agent is known as a window event loop.
// The event loop of a dedicated worker agent, shared worker agent, or service worker agent is known as a worker event loop.
// And the event loop of a worklet agent is known as a worklet event loop.
GC::Root<HTML::EventLoop> event_loop;
virtual void spin_event_loop_until(GC::Root<GC::Function<bool()>> goal_condition) override;
protected:
using JS::Agent::Agent;
};
Agent& relevant_agent(JS::Object const&);
}