[DOM] Do not interrupt worker execution if already scheduled.

This commit is contained in:
Moonchild
2026-04-29 13:28:06 +02:00
committed by roytam1
parent 38dc7b394e
commit bf526d7076
+8
View File
@@ -1477,6 +1477,10 @@ CachePromiseHandler::ResolvedCallback(JSContext* aCx,
JS::Handle<JS::Value> aValue)
{
AssertIsOnMainThread();
// If execution is already schuled, bail.
if (mLoadInfo.mExecutionScheduled) {
return;
}
// May already have been canceled by CacheScriptLoader::Fail from
// CancelMainThread.
MOZ_ASSERT(mLoadInfo.mCacheStatus == ScriptLoadInfo::WritingToCache ||
@@ -1495,6 +1499,10 @@ CachePromiseHandler::RejectedCallback(JSContext* aCx,
JS::Handle<JS::Value> aValue)
{
AssertIsOnMainThread();
// If execution is already schuled, bail.
if (mLoadInfo.mExecutionScheduled) {
return;
}
// May already have been canceled by CacheScriptLoader::Fail from
// CancelMainThread.
MOZ_ASSERT(mLoadInfo.mCacheStatus == ScriptLoadInfo::WritingToCache ||