mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-12 20:42:21 +00:00
Everywhere: Hoist the Libraries folder to the top-level
This commit is contained in:
parent
950e819ee7
commit
93712b24bf
Notes:
github-actions[bot]
2024-11-10 11:51:52 +00:00
Author: https://github.com/trflynn89
Commit: 93712b24bf
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2256
Reviewed-by: https://github.com/sideshowbarker
4547 changed files with 104 additions and 113 deletions
85
Libraries/LibWeb/IndexedDB/IDBDatabase.cpp
Normal file
85
Libraries/LibWeb/IndexedDB/IDBDatabase.cpp
Normal file
|
@ -0,0 +1,85 @@
|
|||
/*
|
||||
* Copyright (c) 2024, stelar7 <dudedbz@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibWeb/Bindings/IDBDatabasePrototype.h>
|
||||
#include <LibWeb/Bindings/Intrinsics.h>
|
||||
#include <LibWeb/HTML/EventNames.h>
|
||||
#include <LibWeb/IndexedDB/IDBDatabase.h>
|
||||
|
||||
namespace Web::IndexedDB {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(IDBDatabase);
|
||||
|
||||
IDBDatabase::IDBDatabase(JS::Realm& realm, Database& db)
|
||||
: EventTarget(realm)
|
||||
, m_name(db.name())
|
||||
, m_object_store_names(HTML::DOMStringList::create(realm, {}))
|
||||
, m_associated_database(db)
|
||||
{
|
||||
db.associate(*this);
|
||||
}
|
||||
|
||||
IDBDatabase::~IDBDatabase() = default;
|
||||
|
||||
JS::NonnullGCPtr<IDBDatabase> IDBDatabase::create(JS::Realm& realm, Database& db)
|
||||
{
|
||||
return realm.heap().allocate<IDBDatabase>(realm, realm, db);
|
||||
}
|
||||
|
||||
void IDBDatabase::initialize(JS::Realm& realm)
|
||||
{
|
||||
Base::initialize(realm);
|
||||
WEB_SET_PROTOTYPE_FOR_INTERFACE(IDBDatabase);
|
||||
}
|
||||
|
||||
void IDBDatabase::visit_edges(Visitor& visitor)
|
||||
{
|
||||
Base::visit_edges(visitor);
|
||||
visitor.visit(m_object_store_names);
|
||||
visitor.visit(m_associated_database);
|
||||
}
|
||||
|
||||
void IDBDatabase::set_onabort(WebIDL::CallbackType* event_handler)
|
||||
{
|
||||
set_event_handler_attribute(HTML::EventNames::abort, event_handler);
|
||||
}
|
||||
|
||||
WebIDL::CallbackType* IDBDatabase::onabort()
|
||||
{
|
||||
return event_handler_attribute(HTML::EventNames::abort);
|
||||
}
|
||||
|
||||
void IDBDatabase::set_onerror(WebIDL::CallbackType* event_handler)
|
||||
{
|
||||
set_event_handler_attribute(HTML::EventNames::error, event_handler);
|
||||
}
|
||||
|
||||
WebIDL::CallbackType* IDBDatabase::onerror()
|
||||
{
|
||||
return event_handler_attribute(HTML::EventNames::error);
|
||||
}
|
||||
|
||||
void IDBDatabase::set_onclose(WebIDL::CallbackType* event_handler)
|
||||
{
|
||||
set_event_handler_attribute(HTML::EventNames::close, event_handler);
|
||||
}
|
||||
|
||||
WebIDL::CallbackType* IDBDatabase::onclose()
|
||||
{
|
||||
return event_handler_attribute(HTML::EventNames::close);
|
||||
}
|
||||
|
||||
void IDBDatabase::set_onversionchange(WebIDL::CallbackType* event_handler)
|
||||
{
|
||||
set_event_handler_attribute(HTML::EventNames::versionchange, event_handler);
|
||||
}
|
||||
|
||||
WebIDL::CallbackType* IDBDatabase::onversionchange()
|
||||
{
|
||||
return event_handler_attribute(HTML::EventNames::versionchange);
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue