mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-19 09:32:52 +00:00
LibWeb: Add stubbed implementation for ServiceWorkerGlobalScope
This commit is contained in:
parent
4417f63ca0
commit
cc11dcc9a1
Notes:
github-actions[bot]
2024-11-30 10:20:37 +00:00
Author: https://github.com/shannonbooth
Commit: cc11dcc9a1
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2653
5 changed files with 65 additions and 0 deletions
|
@ -669,6 +669,7 @@ set(SOURCES
|
|||
ServiceWorker/Registration.cpp
|
||||
ServiceWorker/ServiceWorker.cpp
|
||||
ServiceWorker/ServiceWorkerContainer.cpp
|
||||
ServiceWorker/ServiceWorkerGlobalScope.cpp
|
||||
ServiceWorker/ServiceWorkerRecord.cpp
|
||||
ServiceWorker/ServiceWorkerRegistration.cpp
|
||||
SRI/SRI.cpp
|
||||
|
|
20
Libraries/LibWeb/ServiceWorker/ServiceWorkerGlobalScope.cpp
Normal file
20
Libraries/LibWeb/ServiceWorker/ServiceWorkerGlobalScope.cpp
Normal file
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
* Copyright (c) 2024, Shannon Booth <shannon@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibWeb/ServiceWorker/ServiceWorkerGlobalScope.h>
|
||||
|
||||
namespace Web::ServiceWorker {
|
||||
|
||||
GC_DEFINE_ALLOCATOR(ServiceWorkerGlobalScope);
|
||||
|
||||
ServiceWorkerGlobalScope::~ServiceWorkerGlobalScope() = default;
|
||||
|
||||
ServiceWorkerGlobalScope::ServiceWorkerGlobalScope(JS::Realm& realm, GC::Ref<Web::Page> page)
|
||||
: HTML::WorkerGlobalScope(realm, page)
|
||||
{
|
||||
}
|
||||
|
||||
}
|
25
Libraries/LibWeb/ServiceWorker/ServiceWorkerGlobalScope.h
Normal file
25
Libraries/LibWeb/ServiceWorker/ServiceWorkerGlobalScope.h
Normal file
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* Copyright (c) 2024, 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;
|
||||
|
||||
protected:
|
||||
explicit ServiceWorkerGlobalScope(JS::Realm&, GC::Ref<Web::Page>);
|
||||
};
|
||||
|
||||
}
|
18
Libraries/LibWeb/ServiceWorker/ServiceWorkerGlobalScope.idl
Normal file
18
Libraries/LibWeb/ServiceWorker/ServiceWorkerGlobalScope.idl
Normal file
|
@ -0,0 +1,18 @@
|
|||
#import <DOM/EventHandler.idl>
|
||||
|
||||
// https://w3c.github.io/ServiceWorker/#serviceworkerglobalscope
|
||||
[Global=(Worker,ServiceWorker), Exposed=ServiceWorker, SecureContext]
|
||||
interface ServiceWorkerGlobalScope : WorkerGlobalScope {
|
||||
[FIXME, SameObject] readonly attribute Clients clients;
|
||||
[FIXME, SameObject] readonly attribute ServiceWorkerRegistration registration;
|
||||
[FIXME, SameObject] readonly attribute ServiceWorker serviceWorker;
|
||||
|
||||
[FIXME, NewObject] Promise<undefined> skipWaiting();
|
||||
|
||||
[FIXME] attribute EventHandler oninstall;
|
||||
[FIXME] attribute EventHandler onactivate;
|
||||
[FIXME] attribute EventHandler onfetch;
|
||||
|
||||
[FIXME] attribute EventHandler onmessage;
|
||||
[FIXME] attribute EventHandler onmessageerror;
|
||||
};
|
|
@ -277,6 +277,7 @@ libweb_js_bindings(ResizeObserver/ResizeObserverEntry)
|
|||
libweb_js_bindings(ResizeObserver/ResizeObserverSize)
|
||||
libweb_js_bindings(ServiceWorker/ServiceWorker)
|
||||
libweb_js_bindings(ServiceWorker/ServiceWorkerContainer)
|
||||
libweb_js_bindings(ServiceWorker/ServiceWorkerGlobalScope GLOBAL)
|
||||
libweb_js_bindings(ServiceWorker/ServiceWorkerRegistration)
|
||||
libweb_js_bindings(Streams/ByteLengthQueuingStrategy)
|
||||
libweb_js_bindings(Streams/CountQueuingStrategy)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue