mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 17:55:07 +02:00
LibWeb/IndexedDB: Remove spin_until from checking finished transactions
This commit is contained in:
committed by
Andreas Kling
parent
52b53e52fb
commit
d87c2a55b0
Notes:
github-actions[bot]
2025-10-08 15:26:31 +00:00
Author: https://github.com/Lubrsi Commit: https://github.com/LadybirdBrowser/ladybird/commit/d87c2a55b00 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6182
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright (c) 2025, Luke Wilde <luke@ladybird.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibWeb/IndexedDB/IDBTransaction.h>
|
||||
#include <LibWeb/IndexedDB/Internal/IDBTransactionObserver.h>
|
||||
|
||||
namespace Web::IndexedDB {
|
||||
|
||||
GC_DEFINE_ALLOCATOR(IDBTransactionObserver);
|
||||
|
||||
IDBTransactionObserver::IDBTransactionObserver(IDBTransaction& transaction)
|
||||
: m_transaction(transaction)
|
||||
{
|
||||
m_transaction->register_transaction_observer({}, *this);
|
||||
m_observing = true;
|
||||
}
|
||||
|
||||
IDBTransactionObserver::~IDBTransactionObserver() = default;
|
||||
|
||||
void IDBTransactionObserver::visit_edges(Cell::Visitor& visitor)
|
||||
{
|
||||
Base::visit_edges(visitor);
|
||||
visitor.visit(m_transaction);
|
||||
visitor.visit(m_transaction_finished_observer);
|
||||
}
|
||||
|
||||
void IDBTransactionObserver::finalize()
|
||||
{
|
||||
Base::finalize();
|
||||
unobserve();
|
||||
}
|
||||
|
||||
void IDBTransactionObserver::unobserve()
|
||||
{
|
||||
if (!m_observing)
|
||||
return;
|
||||
|
||||
m_transaction->unregister_transaction_observer({}, *this);
|
||||
m_observing = false;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user