Bug 1800641 - Part 11: Allocate script in ScriptLoadRequest::NoCacheEntryFound. r=nbp

Depends on D197848

Differential Revision: https://phabricator.services.mozilla.com/D197849
This commit is contained in:
Tooru Fujisawa
2024-01-08 14:57:40 +00:00
parent ed418d41dd
commit 60ae165b14
6 changed files with 15 additions and 10 deletions

View File

@@ -162,10 +162,9 @@ const ModuleLoadRequest* ScriptLoadRequest::AsModuleRequest() const {
void ScriptLoadRequest::NoCacheEntryFound() {
MOZ_ASSERT(IsCheckingCache());
MOZ_ASSERT(mURI);
mState = State::Fetching;
}
void ScriptLoadRequest::EnsureScript() {
// At the time where we check in the cache, the mBaseURL is not set, as this
// is resolved by the network. Thus we use the mURI, for checking the cache
// and later replace the mBaseURL using what the Channel->GetURI will provide.
switch (mKind) {
case ScriptKind::eClassic:
case ScriptKind::eImportMap:
@@ -178,6 +177,7 @@ void ScriptLoadRequest::EnsureScript() {
MOZ_ASSERT_UNREACHABLE("EventScripts are not using ScriptLoadRequest");
break;
}
mState = State::Fetching;
}
void ScriptLoadRequest::SetPendingFetchingError() {