mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 10:22:05 -05: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
3 changed files with 16 additions and 2 deletions
|
@ -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…
Add table
Reference in a new issue