LibWeb: Add ServiceWorker discarded flag to ESO

Looking at the spec it doesn't seem like there's a chance for a service
worker client to be an environment but not an environment settings
object. In the case that that changes in the implementation, we can
move it.
This commit is contained in:
Andrew Kaster 2024-09-05 14:35:06 -06:00 committed by Andreas Kling
parent 0ece40c466
commit 237bcbff36
Notes: github-actions[bot] 2024-09-07 09:39:46 +00:00

View file

@ -124,6 +124,9 @@ public:
JS::NonnullGCPtr<StorageAPI::StorageManager> storage_manager();
[[nodiscard]] bool discarded() const { return m_discarded; }
void set_discarded(bool b) { m_discarded = b; }
protected:
explicit EnvironmentSettingsObject(NonnullOwnPtr<JS::ExecutionContext>);
@ -149,6 +152,10 @@ private:
// https://storage.spec.whatwg.org/#api
// Each environment settings object has an associated StorageManager object.
JS::GCPtr<StorageAPI::StorageManager> m_storage_manager;
// 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 };
};
EnvironmentSettingsObject& incumbent_settings_object();