зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1893635 - Handle disconnection from global in IDBFactory::Databases; r=dom-storage-reviewers,webidl,saschanaz,asuth
Differential Revision: https://phabricator.services.mozilla.com/D209206
This commit is contained in:
Родитель
d8e149681f
Коммит
11443624aa
|
@ -400,7 +400,13 @@ RefPtr<IDBOpenDBRequest> IDBFactory::DeleteDatabase(JSContext* aCx,
|
|||
/* aDeleting */ true, aCallerType, aRv);
|
||||
}
|
||||
|
||||
already_AddRefed<Promise> IDBFactory::Databases(JSContext* const aCx) {
|
||||
already_AddRefed<Promise> IDBFactory::Databases(JSContext* const aCx,
|
||||
ErrorResult& aRv) {
|
||||
if (NS_WARN_IF(!GetOwnerGlobal())) {
|
||||
aRv.Throw(NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
RefPtr<Promise> promise = Promise::CreateInfallible(GetOwnerGlobal());
|
||||
|
||||
// Nothing can be done here if we have previously failed to create a
|
||||
|
|
|
@ -156,7 +156,7 @@ class IDBFactory final : public GlobalTeardownObserver, public nsWrapperCache {
|
|||
CallerType aCallerType,
|
||||
ErrorResult& aRv);
|
||||
|
||||
already_AddRefed<Promise> Databases(JSContext* aCx);
|
||||
already_AddRefed<Promise> Databases(JSContext* aCx, ErrorResult& aRv);
|
||||
|
||||
int16_t Cmp(JSContext* aCx, JS::Handle<JS::Value> aFirst,
|
||||
JS::Handle<JS::Value> aSecond, ErrorResult& aRv);
|
||||
|
|
|
@ -33,6 +33,7 @@ interface IDBFactory {
|
|||
IDBOpenDBRequest
|
||||
deleteDatabase(DOMString name);
|
||||
|
||||
[Throws]
|
||||
Promise<sequence<IDBDatabaseInfo>> databases();
|
||||
|
||||
[Throws]
|
||||
|
|
Загрузка…
Ссылка в новой задаче