mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-04 09:22:53 +00:00
LibWeb: Implement nagivator.serviceWorker.getRegistration()
This commit is contained in:
parent
8e410f959c
commit
37e1d6ece1
Notes:
github-actions[bot]
2025-01-30 22:19:44 +00:00
Author: https://github.com/F3n67u
Commit: 37e1d6ece1
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3110
Reviewed-by: https://github.com/ADKaster ✅
12 changed files with 280 additions and 36 deletions
|
@ -15,6 +15,7 @@
|
|||
#include <LibWeb/HTML/EventLoop/EventLoop.h>
|
||||
#include <LibWeb/HTML/Scripting/ModuleMap.h>
|
||||
#include <LibWeb/HTML/Scripting/SerializedEnvironmentSettingsObject.h>
|
||||
#include <LibWeb/ServiceWorker/Registration.h>
|
||||
|
||||
namespace Web::HTML {
|
||||
|
||||
|
@ -105,6 +106,12 @@ public:
|
|||
|
||||
GC::Ref<StorageAPI::StorageManager> storage_manager();
|
||||
|
||||
// https://w3c.github.io/ServiceWorker/#get-the-service-worker-registration-object
|
||||
GC::Ref<ServiceWorker::ServiceWorkerRegistration> get_service_worker_registration_object(ServiceWorker::Registration const&);
|
||||
|
||||
// https://w3c.github.io/ServiceWorker/#get-the-service-worker-object
|
||||
GC::Ref<ServiceWorker::ServiceWorker> get_service_worker_object(ServiceWorker::ServiceWorkerRecord*);
|
||||
|
||||
[[nodiscard]] bool discarded() const { return m_discarded; }
|
||||
void set_discarded(bool b) { m_discarded = b; }
|
||||
|
||||
|
@ -127,6 +134,16 @@ private:
|
|||
// Each environment settings object has an associated StorageManager object.
|
||||
GC::Ptr<StorageAPI::StorageManager> m_storage_manager;
|
||||
|
||||
// https://w3c.github.io/ServiceWorker/#environment-settings-object-service-worker-registration-object-map
|
||||
// An environment settings object has a service worker registration object map,
|
||||
// a map where the keys are service worker registrations and the values are ServiceWorkerRegistration objects.
|
||||
HashMap<ServiceWorker::RegistrationKey, GC::Ref<ServiceWorker::ServiceWorkerRegistration>> m_service_worker_registration_object_map;
|
||||
|
||||
// https://w3c.github.io/ServiceWorker/#environment-settings-object-service-worker-object-map
|
||||
// An environment settings object has a service worker object map,
|
||||
// a map where the keys are service workers and the values are ServiceWorker objects.
|
||||
HashMap<ServiceWorker::ServiceWorkerRecord*, GC::Ref<ServiceWorker::ServiceWorker>> m_service_worker_object_map;
|
||||
|
||||
// https://w3c.github.io/ServiceWorker/#service-worker-client-discarded-flag
|
||||
// A service worker client has an associated discarded flag. It is initially unset.
|
||||
bool m_discarded { false };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue