mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-11 02:29:21 +00:00
LibWeb/ServiceWorker: Add ServiceWorker event names
This commit is contained in:
parent
27efb3b140
commit
50b7e0807d
Notes:
github-actions[bot]
2025-04-25 09:04:00 +00:00
Author: https://github.com/shannonbooth
Commit: 50b7e0807d
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4463
3 changed files with 41 additions and 0 deletions
|
@ -725,6 +725,7 @@ set(SOURCES
|
|||
ResizeObserver/ResizeObserverSize.cpp
|
||||
ResourceTiming/PerformanceResourceTiming.cpp
|
||||
SecureContexts/AbstractOperations.cpp
|
||||
ServiceWorker/EventNames.cpp
|
||||
ServiceWorker/Job.cpp
|
||||
ServiceWorker/Registration.cpp
|
||||
ServiceWorker/ServiceWorker.cpp
|
||||
|
|
16
Libraries/LibWeb/ServiceWorker/EventNames.cpp
Normal file
16
Libraries/LibWeb/ServiceWorker/EventNames.cpp
Normal file
|
@ -0,0 +1,16 @@
|
|||
/*
|
||||
* Copyright (c) 2025, Shannon Booth <shannon@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibWeb/ServiceWorker/EventNames.h>
|
||||
|
||||
namespace Web::ServiceWorker::EventNames {
|
||||
|
||||
#define __ENUMERATE_SERVICE_WORKER_EVENT(name) \
|
||||
FlyString name = #name##_fly_string;
|
||||
ENUMERATE_SERVICE_WORKER_EVENTS
|
||||
#undef __ENUMERATE_SERVICE_WORKER_EVENT
|
||||
|
||||
}
|
24
Libraries/LibWeb/ServiceWorker/EventNames.h
Normal file
24
Libraries/LibWeb/ServiceWorker/EventNames.h
Normal file
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
* Copyright (c) 2025, Shannon Booth <shannon@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/FlyString.h>
|
||||
|
||||
namespace Web::ServiceWorker::EventNames {
|
||||
|
||||
#define ENUMERATE_SERVICE_WORKER_EVENTS \
|
||||
__ENUMERATE_SERVICE_WORKER_EVENT(activate) \
|
||||
__ENUMERATE_SERVICE_WORKER_EVENT(fetch) \
|
||||
__ENUMERATE_SERVICE_WORKER_EVENT(install) \
|
||||
__ENUMERATE_SERVICE_WORKER_EVENT(message) \
|
||||
__ENUMERATE_SERVICE_WORKER_EVENT(messageerror)
|
||||
|
||||
#define __ENUMERATE_SERVICE_WORKER_EVENT(name) extern FlyString name;
|
||||
ENUMERATE_SERVICE_WORKER_EVENTS
|
||||
#undef __ENUMERATE_SERVICE_WORKER_EVENT
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue