Bug 1436400 - Part 9: Support restarting module load request. r=jonco

After enabling bytecode cache for module script, we need to handle
the SRI mismatch on bytecode cache, that requires reloading the script source
again.

Differential Revision: https://phabricator.services.mozilla.com/D140551
This commit is contained in:
Tooru Fujisawa
2022-03-15 19:05:57 +00:00
parent 8a92b769e9
commit 269bab5cb4
5 changed files with 43 additions and 3 deletions

View File

@@ -487,7 +487,12 @@ nsresult ScriptLoader::RestartLoad(ScriptLoadRequest* aRequest) {
// Start a new channel from which we explicitly request to stream the source
// instead of the bytecode.
aRequest->mProgress = ScriptLoadRequest::Progress::eLoading_Source;
nsresult rv = StartLoad(aRequest);
nsresult rv;
if (aRequest->IsModuleRequest()) {
rv = mModuleLoader->RestartModuleLoad(aRequest);
} else {
rv = StartLoad(aRequest);
}
if (NS_FAILED(rv)) {
return rv;
}