LibWeb: Make the static IndexedDB Databases rooted

These should persist for the duration of the program, at least until we
have persistent storage to restore from if a database needs to be used
again.

This fixes a flake in indexeddb-queued-delete-after-open that turns
into a consistent failure (or an assertion failure in GC::Weak in
debug builds) when running the test with the -g flag.
This commit is contained in:
Zaggy1024
2026-03-06 01:30:22 -06:00
committed by Gregory Bertilson
parent 2ab80c9e47
commit aebc4e4a8e
Notes: github-actions[bot] 2026-03-21 05:01:36 +00:00
2 changed files with 8 additions and 12 deletions

View File

@@ -44,7 +44,7 @@ public:
[[nodiscard]] static Vector<GC::Weak<Database>> for_key(StorageAPI::StorageKey const&);
[[nodiscard]] static Optional<Database&> for_key_and_name(StorageAPI::StorageKey const&, String const&);
[[nodiscard]] static ErrorOr<GC::Root<Database>> create_for_key_and_name(JS::Realm&, StorageAPI::StorageKey const&, String const&);
[[nodiscard]] static ErrorOr<GC::Ref<Database>> create_for_key_and_name(JS::Realm&, StorageAPI::StorageKey const&, String const&);
[[nodiscard]] static ErrorOr<void> delete_for_key_and_name(StorageAPI::StorageKey const&, String const&);
static void for_each_database(AK::Function<void(Database&)> const& visitor);