mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-03 06:40:05 +00:00
LibWeb/IDB: Make close_a_database_connection take a GC::Ref
This commit is contained in:
parent
cdf01902ee
commit
d69ae94030
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
|
// 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.
|
// 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: 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.
|
// 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.
|
// 4. If the forced flag is true, then fire an event named close at connection.
|
||||||
if (forced)
|
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
|
// https://w3c.github.io/IndexedDB/#upgrade-a-database
|
||||||
|
|
|
@ -20,7 +20,7 @@ using KeyPath = Variant<String, Vector<String>>;
|
||||||
WebIDL::ExceptionOr<GC::Ref<IDBDatabase>> open_a_database_connection(JS::Realm&, StorageAPI::StorageKey, String, Optional<u64>, GC::Ref<IDBRequest>);
|
WebIDL::ExceptionOr<GC::Ref<IDBDatabase>> open_a_database_connection(JS::Realm&, StorageAPI::StorageKey, String, Optional<u64>, GC::Ref<IDBRequest>);
|
||||||
bool fire_a_version_change_event(JS::Realm&, FlyString const&, GC::Ref<DOM::EventTarget>, u64, Optional<u64>);
|
bool fire_a_version_change_event(JS::Realm&, FlyString const&, GC::Ref<DOM::EventTarget>, u64, Optional<u64>);
|
||||||
ErrorOr<GC::Ref<Key>> convert_a_value_to_a_key(JS::Realm&, JS::Value, Vector<JS::Value> = {});
|
ErrorOr<GC::Ref<Key>> convert_a_value_to_a_key(JS::Realm&, JS::Value, Vector<JS::Value> = {});
|
||||||
void close_a_database_connection(IDBDatabase&, bool forced = false);
|
void close_a_database_connection(GC::Ref<IDBDatabase>, bool forced = false);
|
||||||
GC::Ref<IDBTransaction> upgrade_a_database(JS::Realm&, GC::Ref<IDBDatabase>, u64, GC::Ref<IDBRequest>);
|
GC::Ref<IDBTransaction> upgrade_a_database(JS::Realm&, GC::Ref<IDBDatabase>, u64, GC::Ref<IDBRequest>);
|
||||||
WebIDL::ExceptionOr<u64> delete_a_database(JS::Realm&, StorageAPI::StorageKey, String, GC::Ref<IDBRequest>);
|
WebIDL::ExceptionOr<u64> delete_a_database(JS::Realm&, StorageAPI::StorageKey, String, GC::Ref<IDBRequest>);
|
||||||
void abort_a_transaction(GC::Ref<IDBTransaction>, GC::Ptr<WebIDL::DOMException>);
|
void abort_a_transaction(GC::Ref<IDBTransaction>, GC::Ptr<WebIDL::DOMException>);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue