mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 12:49:19 +00:00
LibWeb/IDB: Implement IDBTransaction::commit
This commit is contained in:
parent
b6b00acbd1
commit
da56c1b1eb
Notes:
github-actions[bot]
2025-04-11 01:14:15 +00:00
Author: https://github.com/stelar7
Commit: da56c1b1eb
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4306
Reviewed-by: https://github.com/ADKaster ✅
5 changed files with 77 additions and 1 deletions
|
@ -103,4 +103,19 @@ GC::Ref<HTML::DOMStringList> IDBTransaction::object_store_names()
|
|||
return create_a_sorted_name_list(realm(), names);
|
||||
}
|
||||
|
||||
// https://w3c.github.io/IndexedDB/#dom-idbtransaction-commit
|
||||
WebIDL::ExceptionOr<void> IDBTransaction::commit()
|
||||
{
|
||||
auto& realm = this->realm();
|
||||
|
||||
// 1. If this's state is not active, then throw an "InvalidStateError" DOMException.
|
||||
if (m_state != TransactionState::Active)
|
||||
return WebIDL::InvalidStateError::create(realm, "Transaction is not active while commiting"_string);
|
||||
|
||||
// 2. Run commit a transaction with this.
|
||||
commit_a_transaction(realm, *this);
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue