Bug 1893164 - Make CancelImport() won't cancel a request if the URI is been waiting by other requests. r=jonco
In the following module graph:
0.html
+---- 1.mjs
+---- non_existing.mjs
+---- 3.mjs
+----- 2.mjs
+---- 3.mjs
Both 1.mjs and 2.mjs have a common submodule called 3.mjs
But 1.mjs also has a non-existing submodule, so we can't instantiate the
module graph of 1.mjs. which in turn will cancel 3.mjs
But 3.mjs is also a sub-module of 2.mjs, so in order to instantiate the
module graph of 2.mjs, we skip canceling 3.mjs when we processed 1.mjs
Differential Revision: https://phabricator.services.mozilla.com/D209210
This commit is contained in:
@@ -1494,6 +1494,17 @@ void ModuleLoaderBase::MoveModulesTo(ModuleLoaderBase* aDest) {
|
||||
mFetchedModules.Clear();
|
||||
}
|
||||
|
||||
bool ModuleLoaderBase::IsFetchingAndHasWaitingRequest(
|
||||
ModuleLoadRequest* aRequest) {
|
||||
auto entry = mFetchingModules.Lookup(aRequest->mURI);
|
||||
if (!entry) {
|
||||
return false;
|
||||
}
|
||||
|
||||
RefPtr<LoadingRequest> loadingRequest = entry.Data();
|
||||
return !loadingRequest->mWaiting.IsEmpty();
|
||||
}
|
||||
|
||||
#undef LOG
|
||||
#undef LOG_ENABLED
|
||||
|
||||
|
||||
Reference in New Issue
Block a user