Bug 1745282 - Remove MOZ_CAN_RUN_SCRIPT_BOUNDARY from RunCallbackAndSettlePromise r=masayuki

Differential Revision: https://phabricator.services.mozilla.com/D133416
This commit is contained in:
Kagami Sascha Rosylight 2021-12-13 18:46:10 +00:00
Родитель fd626fb02c
Коммит 0da673e550
2 изменённых файлов: 8 добавлений и 5 удалений

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

@ -16,8 +16,7 @@ using IPCResult = mozilla::ipc::IPCResult;
NS_IMPL_ISUPPORTS(LockRequestChild, nsISupports)
// XXX: should be MOZ_CAN_RUN_SCRIPT, but not sure how to call it from closures
MOZ_CAN_RUN_SCRIPT_BOUNDARY static void RunCallbackAndSettlePromise(
MOZ_CAN_RUN_SCRIPT static void RunCallbackAndSettlePromise(
LockGrantedCallback& aCallback, mozilla::dom::Lock* lock,
Promise& aPromise) {
ErrorResult rv;
@ -85,7 +84,9 @@ IPCResult LockRequestChild::RecvResolve(const LockMode& aLockMode,
promise = mRequest.mPromise;
}
RunCallbackAndSettlePromise(*mRequest.mCallback, lock, *promise);
// XXX(krosylight): MOZ_KnownLive shouldn't be needed here, mRequest is const
RunCallbackAndSettlePromise(MOZ_KnownLive(*mRequest.mCallback), lock,
*promise);
return IPC_OK();
}

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

@ -35,7 +35,9 @@ class LockRequestChild final : public PLockRequestChild,
void MaybeSetWorkerRef();
IPCResult RecvResolve(const LockMode& aLockMode, bool aIsAvailable);
// TODO: Use MOZ_CAN_RUN_SCRIPT when it gains IPDL support (bug 1539864)
MOZ_CAN_RUN_SCRIPT_BOUNDARY IPCResult RecvResolve(const LockMode& aLockMode,
bool aIsAvailable);
IPCResult Recv__delete__(bool aAborted);
void ActorDestroy(ActorDestroyReason aReason) final;
@ -47,7 +49,7 @@ class LockRequestChild final : public PLockRequestChild,
LockManagerChild* CastedManager() const;
LockRequest mRequest;
const LockRequest mRequest;
RefPtr<StrongWorkerRef> mWorkerRef;
};