mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibWeb/IndexedDB: Remove spin_until from request processing
This commit is contained in:
committed by
Andreas Kling
parent
6d43e3cc93
commit
5c69784ef9
Notes:
github-actions[bot]
2025-10-08 15:26:51 +00:00
Author: https://github.com/Lubrsi Commit: https://github.com/LadybirdBrowser/ladybird/commit/5c69784ef9f Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6182
41
Libraries/LibWeb/IndexedDB/Internal/IDBRequestObserver.h
Normal file
41
Libraries/LibWeb/IndexedDB/Internal/IDBRequestObserver.h
Normal file
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* Copyright (c) 2025, Luke Wilde <luke@ladybird.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LibGC/Cell.h>
|
||||
#include <LibGC/CellAllocator.h>
|
||||
#include <LibWeb/Forward.h>
|
||||
|
||||
namespace Web::IndexedDB {
|
||||
|
||||
class IDBRequestObserver final : public GC::Cell {
|
||||
GC_CELL(IDBRequestObserver, GC::Cell);
|
||||
GC_DECLARE_ALLOCATOR(IDBRequestObserver);
|
||||
|
||||
public:
|
||||
virtual ~IDBRequestObserver();
|
||||
|
||||
[[nodiscard]] GC::Ptr<GC::Function<void()>> request_processed_changed_observer() const { return m_request_processed_changed_observer; }
|
||||
void set_request_processed_changed_observer(GC::Ptr<GC::Function<void()>> callback) { m_request_processed_changed_observer = callback; }
|
||||
|
||||
GC::Ref<IDBRequest> request() const { return m_request; }
|
||||
|
||||
void unobserve();
|
||||
|
||||
private:
|
||||
explicit IDBRequestObserver(IDBRequest&);
|
||||
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
virtual void finalize() override;
|
||||
|
||||
bool m_observing { false };
|
||||
|
||||
GC::Ref<IDBRequest> m_request;
|
||||
GC::Ptr<GC::Function<void()>> m_request_processed_changed_observer;
|
||||
};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user