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
Родитель 3637d91f2c
Коммит 83f211d36f
5 изменённых файлов: 10 добавлений и 12 удалений

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

2
tools/@types/lib.gecko.dom.d.ts поставляемый
Просмотреть файл

@ -17902,7 +17902,7 @@ interface IDBFactory {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/IDBFactory/cmp) */
cmp(first: any, second: any): number;
/** [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;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/IDBFactory/open) */
open(name: string, version?: number): IDBOpenDBRequest;