Bug 1646793 - Cancel all preload requests when the ScriptLoader is destroyed r=smaug

Cancel all preload requests when the ScriptLoader is destroyed.

Differential Revision: https://phabricator.services.mozilla.com/D80218
This commit is contained in:
Denis Palmeiro
2020-06-22 02:12:56 +00:00
parent 621688a7f3
commit f573fa0aab

View File

@@ -229,7 +229,9 @@ ScriptLoader::~ScriptLoader() {
mPendingChildLoaders[j]->RemoveParserBlockingScriptExecutionBlocker();
}
// Cancel any unused preload requests
for (size_t i = 0; i < mPreloads.Length(); i++) {
mPreloads[i].mRequest->Cancel();
AccumulateCategorical(LABELS_DOM_SCRIPT_PRELOAD_RESULT::NotUsed);
}
}
@@ -2118,8 +2120,7 @@ nsresult ScriptLoader::ProcessOffThreadRequest(ScriptLoadRequest* aRequest) {
// Async scripts and blocking scripts can be executed right away.
if (aRequest->IsAsyncScript() || aRequest->IsBlockingScript()) {
nsresult rv = ProcessRequest(aRequest);
return rv;
return ProcessRequest(aRequest);
}
// Process other scripts in the proper order.