Bug 1890730 - Fix IDBFactory deleteDatabase to not use IDBOpenDBOptions. r=dom-storage-reviewers,webidl,smaug,asuth

Differential Revision: https://phabricator.services.mozilla.com/D207168
This commit is contained in:
Jari Jalkanen 2024-04-22 04:46:59 +00:00
parent 3637d91f2c
commit 83f211d36f
5 changed files with 10 additions and 12 deletions

View file

@ -35,9 +35,6 @@ module.exports = Object.freeze({
return indexedDB.openForPrincipal(principal, name, options); return indexedDB.openForPrincipal(principal, name, options);
}, },
/**
* Only the standard version of indexedDB.deleteDatabase is supported.
*/
deleteDatabase(name) { deleteDatabase(name) {
return indexedDB.deleteForPrincipal(principal, name); return indexedDB.deleteForPrincipal(principal, name);
}, },

View file

@ -391,9 +391,10 @@ RefPtr<IDBOpenDBRequest> IDBFactory::Open(JSContext* aCx,
/* aDeleting */ false, aCallerType, aRv); /* aDeleting */ false, aCallerType, aRv);
} }
RefPtr<IDBOpenDBRequest> IDBFactory::DeleteDatabase( RefPtr<IDBOpenDBRequest> IDBFactory::DeleteDatabase(JSContext* aCx,
JSContext* aCx, const nsAString& aName, const IDBOpenDBOptions& aOptions, const nsAString& aName,
CallerType aCallerType, ErrorResult& aRv) { CallerType aCallerType,
ErrorResult& aRv) {
return OpenInternal(aCx, return OpenInternal(aCx,
/* aPrincipal */ nullptr, aName, Optional<uint64_t>(), /* aPrincipal */ nullptr, aName, Optional<uint64_t>(),
/* aDeleting */ true, aCallerType, aRv); /* aDeleting */ true, aCallerType, aRv);

View file

@ -151,9 +151,10 @@ class IDBFactory final : public GlobalTeardownObserver, public nsWrapperCache {
const Optional<uint64_t>& aVersion, CallerType aCallerType, const Optional<uint64_t>& aVersion, CallerType aCallerType,
ErrorResult& aRv); ErrorResult& aRv);
[[nodiscard]] RefPtr<IDBOpenDBRequest> DeleteDatabase( [[nodiscard]] RefPtr<IDBOpenDBRequest> DeleteDatabase(JSContext* aCx,
JSContext* aCx, const nsAString& aName, const IDBOpenDBOptions& aOptions, const nsAString& aName,
CallerType aCallerType, ErrorResult& aRv); CallerType aCallerType,
ErrorResult& aRv);
already_AddRefed<Promise> Databases(JSContext* aCx); already_AddRefed<Promise> Databases(JSContext* aCx);

View file

@ -31,8 +31,7 @@ interface IDBFactory {
[NewObject, Throws, NeedsCallerType] [NewObject, Throws, NeedsCallerType]
IDBOpenDBRequest IDBOpenDBRequest
deleteDatabase(DOMString name, deleteDatabase(DOMString name);
optional IDBOpenDBOptions options = {});
Promise<sequence<IDBDatabaseInfo>> databases(); Promise<sequence<IDBDatabaseInfo>> databases();

View file

@ -17902,7 +17902,7 @@ interface IDBFactory {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/IDBFactory/cmp) */ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/IDBFactory/cmp) */
cmp(first: any, second: any): number; cmp(first: any, second: any): number;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/IDBFactory/deleteDatabase) */ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/IDBFactory/deleteDatabase) */
deleteDatabase(name: string, options?: IDBOpenDBOptions): IDBOpenDBRequest; deleteDatabase(name: string): IDBOpenDBRequest;
deleteForPrincipal(principal: Principal, name: string, options?: IDBOpenDBOptions): IDBOpenDBRequest; deleteForPrincipal(principal: Principal, name: string, options?: IDBOpenDBOptions): IDBOpenDBRequest;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/IDBFactory/open) */ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/IDBFactory/open) */
open(name: string, version?: number): IDBOpenDBRequest; open(name: string, version?: number): IDBOpenDBRequest;