mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 05:25:32 +03:00
LibWeb: Add stub for IDBFactory.open
I saw that this not being implemented was causing a javascript exception to be thrown when loading https://profiler.firefox.com/. I was hoping that like the last time that partially implementing this interface would allow the page to load further, but it seems that this is unfortunately not the case this time! However, this may help other pages load slightly further, and puts some of the scaffolding in place for a proper implementation :^)
This commit is contained in:
parent
3aa36caa52
commit
f7beea1397
Notes:
sideshowbarker
2024-07-16 19:57:55 +09:00
Author: https://github.com/shannonbooth Commit: https://github.com/SerenityOS/serenity/commit/f7beea1397 Pull-request: https://github.com/SerenityOS/serenity/pull/24377 Reviewed-by: https://github.com/tcl3
@ -7,6 +7,7 @@
|
||||
#include <LibWeb/Bindings/IDBFactoryPrototype.h>
|
||||
#include <LibWeb/Bindings/Intrinsics.h>
|
||||
#include <LibWeb/IndexedDB/IDBFactory.h>
|
||||
#include <LibWeb/IndexedDB/IDBOpenDBRequest.h>
|
||||
|
||||
namespace Web::IndexedDB {
|
||||
|
||||
@ -25,4 +26,12 @@ void IDBFactory::initialize(JS::Realm& realm)
|
||||
WEB_SET_PROTOTYPE_FOR_INTERFACE(IDBFactory);
|
||||
}
|
||||
|
||||
// https://w3c.github.io/IndexedDB/#dom-idbfactory-open
|
||||
JS::NonnullGCPtr<IDBOpenDBRequest> IDBFactory::open(String const&, Optional<WebIDL::UnsignedLongLong>)
|
||||
{
|
||||
dbgln("FIXME: Implement IDBFactory::open");
|
||||
auto& realm = this->realm();
|
||||
return vm().heap().allocate<IDBOpenDBRequest>(realm, realm);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -7,6 +7,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <LibWeb/Bindings/PlatformObject.h>
|
||||
#include <LibWeb/WebIDL/Types.h>
|
||||
|
||||
namespace Web::IndexedDB {
|
||||
|
||||
@ -18,6 +19,8 @@ class IDBFactory : public Bindings::PlatformObject {
|
||||
public:
|
||||
virtual ~IDBFactory() override;
|
||||
|
||||
JS::NonnullGCPtr<IDBOpenDBRequest> open(String const& name, Optional<WebIDL::UnsignedLongLong> version = {});
|
||||
|
||||
protected:
|
||||
explicit IDBFactory(JS::Realm&);
|
||||
|
||||
|
@ -1,8 +1,10 @@
|
||||
#import <IndexedDB/IDBOpenDBRequest.idl>
|
||||
|
||||
// https://w3c.github.io/IndexedDB/#idbfactory
|
||||
[Exposed=(Window,Worker)]
|
||||
interface IDBFactory {
|
||||
// FIXME: [NewObject] IDBOpenDBRequest open(DOMString name,
|
||||
// optional [EnforceRange] unsigned long long version);
|
||||
[NewObject] IDBOpenDBRequest open(DOMString name,
|
||||
optional [EnforceRange] unsigned long long version);
|
||||
// FIXME: [NewObject] IDBOpenDBRequest deleteDatabase(DOMString name);
|
||||
|
||||
// FIXME: Promise<sequence<IDBDatabaseInfo>> databases();
|
||||
|
Loading…
Reference in New Issue
Block a user