2024-11-07 18:56:26 +01:00
|
|
|
/*
|
2025-03-24 20:43:12 +01:00
|
|
|
* Copyright (c) 2024-2025, stelar7 <dudedbz@gmail.com>
|
2024-11-07 18:56:26 +01:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <LibWeb/Bindings/IDBObjectStorePrototype.h>
|
|
|
|
#include <LibWeb/Bindings/Intrinsics.h>
|
|
|
|
#include <LibWeb/HTML/EventNames.h>
|
|
|
|
#include <LibWeb/IndexedDB/IDBObjectStore.h>
|
|
|
|
|
|
|
|
namespace Web::IndexedDB {
|
|
|
|
|
|
|
|
GC_DEFINE_ALLOCATOR(IDBObjectStore);
|
|
|
|
|
|
|
|
IDBObjectStore::~IDBObjectStore() = default;
|
|
|
|
|
2025-03-24 20:43:12 +01:00
|
|
|
IDBObjectStore::IDBObjectStore(JS::Realm& realm, GC::Ref<ObjectStore> store, GC::Ref<IDBTransaction> transaction)
|
2024-11-07 18:56:26 +01:00
|
|
|
: PlatformObject(realm)
|
2025-03-24 20:43:12 +01:00
|
|
|
, m_store(store)
|
|
|
|
, m_transaction(transaction)
|
2024-11-07 18:56:26 +01:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2025-03-24 20:43:12 +01:00
|
|
|
GC::Ref<IDBObjectStore> IDBObjectStore::create(JS::Realm& realm, GC::Ref<ObjectStore> store, GC::Ref<IDBTransaction> transaction)
|
2024-11-07 18:56:26 +01:00
|
|
|
{
|
2025-03-24 20:43:12 +01:00
|
|
|
return realm.create<IDBObjectStore>(realm, store, transaction);
|
2024-11-07 18:56:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void IDBObjectStore::initialize(JS::Realm& realm)
|
|
|
|
{
|
|
|
|
Base::initialize(realm);
|
|
|
|
WEB_SET_PROTOTYPE_FOR_INTERFACE(IDBObjectStore);
|
|
|
|
}
|
|
|
|
|
2025-03-24 20:43:12 +01:00
|
|
|
void IDBObjectStore::visit_edges(Visitor& visitor)
|
|
|
|
{
|
|
|
|
Base::visit_edges(visitor);
|
|
|
|
visitor.visit(m_store);
|
|
|
|
visitor.visit(m_transaction);
|
|
|
|
}
|
|
|
|
|
2024-11-07 18:56:26 +01:00
|
|
|
}
|