LibWeb: Add active_credential_types to EnvironmentSettingsObject

This commit is contained in:
devgianlu 2025-02-07 16:40:39 +01:00
parent 3bf2078d33
commit ddf0b45c04
2 changed files with 13 additions and 0 deletions

View file

@ -646,4 +646,10 @@ GC::Ref<ServiceWorker::ServiceWorker> EnvironmentSettingsObject::get_service_wor
return *object_map.get(service_worker);
}
// https://w3c.github.io/webappsec-credential-management/#active-credential-types
Vector<String>& EnvironmentSettingsObject::active_credential_types()
{
return m_active_credential_types;
}
}

View file

@ -124,6 +124,9 @@ public:
// https://w3c.github.io/ServiceWorker/#get-the-service-worker-object
GC::Ref<ServiceWorker::ServiceWorker> get_service_worker_object(ServiceWorker::ServiceWorkerRecord*);
// https://w3c.github.io/webappsec-credential-management/#active-credential-types
Vector<String>& active_credential_types();
[[nodiscard]] bool discarded() const { return m_discarded; }
void set_discarded(bool b) { m_discarded = b; }
@ -158,6 +161,10 @@ private:
// 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/webappsec-credential-management/#active-credential-types
// Each environment settings object has an associated active credential types, a set which is initially empty.
Vector<String> m_active_credential_types;
// 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 };