mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-10 11:36:22 +00:00
LibWeb: Add stub interface for IDBRequest
This commit is contained in:
parent
8d5665ebe1
commit
bfa330914d
Notes:
sideshowbarker
2024-07-16 23:34:49 +09:00
Author: https://github.com/shannonbooth
Commit: bfa330914d
Pull-request: https://github.com/SerenityOS/serenity/pull/24377
Reviewed-by: https://github.com/tcl3
6 changed files with 77 additions and 0 deletions
|
@ -448,6 +448,7 @@ set(SOURCES
|
||||||
Infra/JSON.cpp
|
Infra/JSON.cpp
|
||||||
Infra/Strings.cpp
|
Infra/Strings.cpp
|
||||||
IndexedDB/IDBFactory.cpp
|
IndexedDB/IDBFactory.cpp
|
||||||
|
IndexedDB/IDBRequest.cpp
|
||||||
Internals/Inspector.cpp
|
Internals/Inspector.cpp
|
||||||
Internals/InternalAnimationTimeline.cpp
|
Internals/InternalAnimationTimeline.cpp
|
||||||
Internals/Internals.cpp
|
Internals/Internals.cpp
|
||||||
|
|
|
@ -500,6 +500,7 @@ class Performance;
|
||||||
|
|
||||||
namespace Web::IndexedDB {
|
namespace Web::IndexedDB {
|
||||||
class IDBFactory;
|
class IDBFactory;
|
||||||
|
class IDBRequest;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace Web::Internals {
|
namespace Web::Internals {
|
||||||
|
|
28
Userland/Libraries/LibWeb/IndexedDB/IDBRequest.cpp
Normal file
28
Userland/Libraries/LibWeb/IndexedDB/IDBRequest.cpp
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2024, Shannon Booth <shannon@serenityos.org>
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <LibWeb/Bindings/IDBRequestPrototype.h>
|
||||||
|
#include <LibWeb/Bindings/Intrinsics.h>
|
||||||
|
#include <LibWeb/IndexedDB/IDBRequest.h>
|
||||||
|
|
||||||
|
namespace Web::IndexedDB {
|
||||||
|
|
||||||
|
JS_DEFINE_ALLOCATOR(IDBRequest);
|
||||||
|
|
||||||
|
IDBRequest::~IDBRequest() = default;
|
||||||
|
|
||||||
|
IDBRequest::IDBRequest(JS::Realm& realm)
|
||||||
|
: EventTarget(realm)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void IDBRequest::initialize(JS::Realm& realm)
|
||||||
|
{
|
||||||
|
Base::initialize(realm);
|
||||||
|
WEB_SET_PROTOTYPE_FOR_INTERFACE(IDBRequest);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
26
Userland/Libraries/LibWeb/IndexedDB/IDBRequest.h
Normal file
26
Userland/Libraries/LibWeb/IndexedDB/IDBRequest.h
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2024, Shannon Booth <shannon@serenityos.org>
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <LibWeb/DOM/EventTarget.h>
|
||||||
|
|
||||||
|
namespace Web::IndexedDB {
|
||||||
|
|
||||||
|
class IDBRequest : public DOM::EventTarget {
|
||||||
|
WEB_PLATFORM_OBJECT(IDBRequest, EventTarget);
|
||||||
|
JS_DECLARE_ALLOCATOR(IDBRequest);
|
||||||
|
|
||||||
|
public:
|
||||||
|
virtual ~IDBRequest() override;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
explicit IDBRequest(JS::Realm&);
|
||||||
|
|
||||||
|
virtual void initialize(JS::Realm&) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
20
Userland/Libraries/LibWeb/IndexedDB/IDBRequest.idl
Normal file
20
Userland/Libraries/LibWeb/IndexedDB/IDBRequest.idl
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
#import <DOM/EventTarget.idl>
|
||||||
|
|
||||||
|
// https://w3c.github.io/IndexedDB/#idbrequest
|
||||||
|
[Exposed=(Window,Worker)]
|
||||||
|
interface IDBRequest : EventTarget {
|
||||||
|
// FIXME: readonly attribute any result;
|
||||||
|
// FIXME: readonly attribute DOMException? error;
|
||||||
|
// FIXME: readonly attribute (IDBObjectStore or IDBIndex or IDBCursor)? source;
|
||||||
|
// FIXME: readonly attribute IDBTransaction? transaction;
|
||||||
|
// FIXME: readonly attribute IDBRequestReadyState readyState;
|
||||||
|
|
||||||
|
// Event handlers:
|
||||||
|
// FIXME: attribute EventHandler onsuccess;
|
||||||
|
// FIXME: attribute EventHandler onerror;
|
||||||
|
};
|
||||||
|
|
||||||
|
enum IDBRequestReadyState {
|
||||||
|
"pending",
|
||||||
|
"done"
|
||||||
|
};
|
|
@ -217,6 +217,7 @@ libweb_js_bindings(HTML/WorkerLocation)
|
||||||
libweb_js_bindings(HTML/WorkerNavigator)
|
libweb_js_bindings(HTML/WorkerNavigator)
|
||||||
libweb_js_bindings(HighResolutionTime/Performance)
|
libweb_js_bindings(HighResolutionTime/Performance)
|
||||||
libweb_js_bindings(IndexedDB/IDBFactory)
|
libweb_js_bindings(IndexedDB/IDBFactory)
|
||||||
|
libweb_js_bindings(IndexedDB/IDBRequest)
|
||||||
libweb_js_bindings(Internals/Inspector)
|
libweb_js_bindings(Internals/Inspector)
|
||||||
libweb_js_bindings(Internals/InternalAnimationTimeline)
|
libweb_js_bindings(Internals/InternalAnimationTimeline)
|
||||||
libweb_js_bindings(Internals/Internals)
|
libweb_js_bindings(Internals/Internals)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue