LibWeb/ServiceWorker: Implement ServiceWorkerGlobalScope event handlers

This commit is contained in:
Shannon Booth 2025-04-25 17:41:40 +12:00 committed by Andreas Kling
commit 3bb36d9379
Notes: github-actions[bot] 2025-04-25 09:03:54 +00:00
3 changed files with 83 additions and 7 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2024, Shannon Booth <shannon@serenityos.org>
* Copyright (c) 2024-2025, Shannon Booth <shannon@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -18,6 +18,21 @@ class ServiceWorkerGlobalScope : public HTML::WorkerGlobalScope {
public:
virtual ~ServiceWorkerGlobalScope() override;
void set_oninstall(GC::Ptr<WebIDL::CallbackType>);
GC::Ptr<WebIDL::CallbackType> oninstall();
void set_onactivate(GC::Ptr<WebIDL::CallbackType>);
GC::Ptr<WebIDL::CallbackType> onactivate();
void set_onfetch(GC::Ptr<WebIDL::CallbackType>);
GC::Ptr<WebIDL::CallbackType> onfetch();
void set_onmessage(GC::Ptr<WebIDL::CallbackType>);
GC::Ptr<WebIDL::CallbackType> onmessage();
void set_onmessageerror(GC::Ptr<WebIDL::CallbackType>);
GC::Ptr<WebIDL::CallbackType> onmessageerror();
protected:
explicit ServiceWorkerGlobalScope(JS::Realm&, GC::Ref<Web::Page>);
};