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 04:24:52 +00:00
parent 19684deae9
commit f7cf7c27a9
5 changed files with 43 additions and 3 deletions

View File

@@ -113,6 +113,12 @@ bool ModuleLoaderBase::ModuleMapContainsURL(nsIURI* aURL,
return mFetchingModules.Contains(key) || mFetchedModules.Contains(key);
}
bool ModuleLoaderBase::IsModuleFetching(nsIURI* aURL,
nsIGlobalObject* aGlobal) const {
ModuleMapKey key(aURL, aGlobal);
return mFetchingModules.Contains(key);
}
void ModuleLoaderBase::SetModuleFetchStarted(ModuleLoadRequest* aRequest) {
// Update the module map to indicate that a module is currently being fetched.