mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 09:39:39 +00:00
LibWeb: Close the database if the upgrade connection is aborted
This commit is contained in:
parent
0b8f2a8b81
commit
a25bba27fa
Notes:
github-actions[bot]
2024-12-14 22:04:06 +00:00
Author: https://github.com/stelar7
Commit: a25bba27fa
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2696
Reviewed-by: https://github.com/gmta
4 changed files with 20 additions and 8 deletions
|
@ -37,11 +37,13 @@ public:
|
|||
[[nodiscard]] GC::Ref<IDBDatabase> connection() const { return m_connection; }
|
||||
[[nodiscard]] Bindings::IDBTransactionDurability durability() const { return m_durability; }
|
||||
[[nodiscard]] GC::Ptr<IDBRequest> associated_request() const { return m_associated_request; }
|
||||
[[nodiscard]] bool aborted() const { return m_aborted; }
|
||||
|
||||
void set_mode(Bindings::IDBTransactionMode mode) { m_mode = mode; }
|
||||
void set_state(TransactionState state) { m_state = state; }
|
||||
void set_error(GC::Ptr<WebIDL::DOMException> error) { m_error = error; }
|
||||
void set_associated_request(GC::Ptr<IDBRequest> request) { m_associated_request = request; }
|
||||
void set_aborted(bool aborted) { m_aborted = aborted; }
|
||||
|
||||
[[nodiscard]] bool is_upgrade_transaction() const { return m_mode == Bindings::IDBTransactionMode::Versionchange; }
|
||||
[[nodiscard]] bool is_readonly() const { return m_mode == Bindings::IDBTransactionMode::Readonly; }
|
||||
|
@ -69,5 +71,6 @@ private:
|
|||
GC::Ptr<WebIDL::DOMException> m_error;
|
||||
|
||||
GC::Ptr<IDBRequest> m_associated_request;
|
||||
bool m_aborted { false };
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue