mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-08 05:27:14 +09:00
40 lines
1.1 KiB
C++
40 lines
1.1 KiB
C++
/*
|
|
* Copyright (c) 2024-2025, Shannon Booth <shannon@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibWeb/HTML/WorkerGlobalScope.h>
|
|
|
|
namespace Web::ServiceWorker {
|
|
|
|
// https://w3c.github.io/ServiceWorker/#serviceworkerglobalscope
|
|
class ServiceWorkerGlobalScope : public HTML::WorkerGlobalScope {
|
|
WEB_PLATFORM_OBJECT(ServiceWorkerGlobalScope, HTML::WorkerGlobalScope);
|
|
GC_DECLARE_ALLOCATOR(ServiceWorkerGlobalScope);
|
|
|
|
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>);
|
|
};
|
|
|
|
}
|