import from UXP: [DOM] Do not interrupt worker execution if already scheduled. (bf526d70)

This commit is contained in:
2026-04-30 10:33:36 +08:00
parent 96709570cf
commit b79b897b6e
+8
View File
@@ -1474,6 +1474,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 ||
@@ -1492,6 +1496,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 ||