mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 17:55:07 +02:00
LibWeb/HTML: Add environment discarding steps
Exactly one place seems to define these at the moment: service worker clients. Since we don't have a type for these and just use EnvironmentSettingsObject, I've put it there.
This commit is contained in:
committed by
Jelle Raaijmakers
parent
a15a55e858
commit
5a4f15d8f5
Notes:
github-actions[bot]
2025-03-14 17:06:43 +00:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/LadybirdBrowser/ladybird/commit/5a4f15d8f58 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3914 Reviewed-by: https://github.com/gmta ✅
@@ -67,6 +67,15 @@ void EnvironmentSettingsObject::visit_edges(Cell::Visitor& visitor)
|
||||
visitor.visit(m_service_worker_object_map);
|
||||
}
|
||||
|
||||
void EnvironmentSettingsObject::discard_environment()
|
||||
{
|
||||
// https://w3c.github.io/ServiceWorker/#ref-for-environment-discarding-steps
|
||||
// Each service worker client has the following environment discarding steps:
|
||||
|
||||
// 1. Set client’s discarded flag.
|
||||
set_discarded(true);
|
||||
}
|
||||
|
||||
JS::ExecutionContext& EnvironmentSettingsObject::realm_execution_context()
|
||||
{
|
||||
// NOTE: All environment settings objects are created with a realm execution context, so it's stored and returned here in the base class.
|
||||
|
||||
Reference in New Issue
Block a user