mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-06 08:10:02 +00:00
LibWeb: Add service worker client to ServiceWorkerContainer
This commit is contained in:
parent
ade4fc1779
commit
0ece40c466
Notes:
github-actions[bot]
2024-09-07 09:39:51 +00:00
Author: https://github.com/ADKaster
Commit: 0ece40c466
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1293
Reviewed-by: https://github.com/awesomekling
2 changed files with 13 additions and 1 deletions
|
@ -17,15 +17,24 @@ JS_DEFINE_ALLOCATOR(ServiceWorkerContainer);
|
||||||
|
|
||||||
ServiceWorkerContainer::ServiceWorkerContainer(JS::Realm& realm)
|
ServiceWorkerContainer::ServiceWorkerContainer(JS::Realm& realm)
|
||||||
: DOM::EventTarget(realm)
|
: DOM::EventTarget(realm)
|
||||||
|
, m_service_worker_client(relevant_settings_object(*this))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ServiceWorkerContainer::~ServiceWorkerContainer() = default;
|
||||||
|
|
||||||
void ServiceWorkerContainer::initialize(JS::Realm& realm)
|
void ServiceWorkerContainer::initialize(JS::Realm& realm)
|
||||||
{
|
{
|
||||||
Base::initialize(realm);
|
Base::initialize(realm);
|
||||||
WEB_SET_PROTOTYPE_FOR_INTERFACE(ServiceWorkerContainer);
|
WEB_SET_PROTOTYPE_FOR_INTERFACE(ServiceWorkerContainer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ServiceWorkerContainer::visit_edges(Cell::Visitor& visitor)
|
||||||
|
{
|
||||||
|
Base::visit_edges(visitor);
|
||||||
|
visitor.visit(m_service_worker_client);
|
||||||
|
}
|
||||||
|
|
||||||
JS::NonnullGCPtr<ServiceWorkerContainer> ServiceWorkerContainer::create(JS::Realm& realm)
|
JS::NonnullGCPtr<ServiceWorkerContainer> ServiceWorkerContainer::create(JS::Realm& realm)
|
||||||
{
|
{
|
||||||
return realm.heap().allocate<ServiceWorkerContainer>(realm, realm);
|
return realm.heap().allocate<ServiceWorkerContainer>(realm, realm);
|
||||||
|
|
|
@ -22,7 +22,7 @@ class ServiceWorkerContainer : public DOM::EventTarget {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
[[nodiscard]] static JS::NonnullGCPtr<ServiceWorkerContainer> create(JS::Realm& realm);
|
[[nodiscard]] static JS::NonnullGCPtr<ServiceWorkerContainer> create(JS::Realm& realm);
|
||||||
virtual ~ServiceWorkerContainer() override = default;
|
virtual ~ServiceWorkerContainer() override;
|
||||||
|
|
||||||
#undef __ENUMERATE
|
#undef __ENUMERATE
|
||||||
#define __ENUMERATE(attribute_name, event_name) \
|
#define __ENUMERATE(attribute_name, event_name) \
|
||||||
|
@ -35,6 +35,9 @@ private:
|
||||||
explicit ServiceWorkerContainer(JS::Realm&);
|
explicit ServiceWorkerContainer(JS::Realm&);
|
||||||
|
|
||||||
virtual void initialize(JS::Realm&) override;
|
virtual void initialize(JS::Realm&) override;
|
||||||
|
virtual void visit_edges(Cell::Visitor&) override;
|
||||||
|
|
||||||
|
JS::NonnullGCPtr<EnvironmentSettingsObject> m_service_worker_client;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue