mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-19 15:32:31 +00:00
LibWeb/IDB: Make close_a_database_connection take a GC::Ref
This commit is contained in:
parent
7c3de67b16
commit
d1dabb9039
Notes:
github-actions[bot]
2025-04-11 01:14:37 +00:00
Author: https://github.com/stelar7
Commit: d1dabb9039
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4306
Reviewed-by: https://github.com/ADKaster ✅
2 changed files with 5 additions and 5 deletions
|
@ -313,18 +313,18 @@ ErrorOr<GC::Ref<Key>> convert_a_value_to_a_key(JS::Realm& realm, JS::Value input
|
|||
}
|
||||
|
||||
// https://w3c.github.io/IndexedDB/#close-a-database-connection
|
||||
void close_a_database_connection(IDBDatabase& connection, bool forced)
|
||||
void close_a_database_connection(GC::Ref<IDBDatabase> connection, bool forced)
|
||||
{
|
||||
// 1. Set connection’s close pending flag to true.
|
||||
connection.set_close_pending(true);
|
||||
connection->set_close_pending(true);
|
||||
|
||||
// FIXME: 2. If the forced flag is true, then for each transaction created using connection run abort a transaction with transaction and newly created "AbortError" DOMException.
|
||||
// FIXME: 3. Wait for all transactions created using connection to complete. Once they are complete, connection is closed.
|
||||
connection.set_state(IDBDatabase::ConnectionState::Closed);
|
||||
connection->set_state(IDBDatabase::ConnectionState::Closed);
|
||||
|
||||
// 4. If the forced flag is true, then fire an event named close at connection.
|
||||
if (forced)
|
||||
connection.dispatch_event(DOM::Event::create(connection.realm(), HTML::EventNames::close));
|
||||
connection->dispatch_event(DOM::Event::create(connection->realm(), HTML::EventNames::close));
|
||||
}
|
||||
|
||||
// https://w3c.github.io/IndexedDB/#upgrade-a-database
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue