mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 04:39:06 +00:00
LibWeb/IDB: Implement IDBCursorWithValue interface
This commit is contained in:
parent
9c51326fcb
commit
296d9d74d8
Notes:
github-actions[bot]
2025-05-13 16:49:47 +00:00
Author: https://github.com/stelar7
Commit: 296d9d74d8
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4720
Reviewed-by: https://github.com/ADKaster ✅
Reviewed-by: https://github.com/AtkinsSJ ✅
Reviewed-by: https://github.com/shannonbooth
10 changed files with 74 additions and 4 deletions
30
Libraries/LibWeb/IndexedDB/IDBCursorWithValue.h
Normal file
30
Libraries/LibWeb/IndexedDB/IDBCursorWithValue.h
Normal file
|
@ -0,0 +1,30 @@
|
|||
/*
|
||||
* Copyright (c) 2025, stelar7 <dudedbz@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LibWeb/IndexedDB/IDBCursor.h>
|
||||
|
||||
namespace Web::IndexedDB {
|
||||
|
||||
// https://w3c.github.io/IndexedDB/#idbcursorwithvalue
|
||||
class IDBCursorWithValue : public IDBCursor {
|
||||
WEB_PLATFORM_OBJECT(IDBCursorWithValue, IDBCursor);
|
||||
GC_DECLARE_ALLOCATOR(IDBCursorWithValue);
|
||||
|
||||
public:
|
||||
virtual ~IDBCursorWithValue() override;
|
||||
|
||||
// https://w3c.github.io/IndexedDB/#dom-idbcursorwithvalue-value
|
||||
[[nodiscard]] JS::Value value() { return m_value.value_or(JS::js_undefined()); }
|
||||
|
||||
private:
|
||||
explicit IDBCursorWithValue(JS::Realm&, CursorSourceHandle, GC::Ptr<Key>, Bindings::IDBCursorDirection, GotValue, GC::Ptr<Key>, JS::Value, GC::Ref<IDBKeyRange>, KeyOnly);
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Visitor& visitor) override;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue