зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1822452 - Reject any remaining requests; r=jonco
This patch allows us to reject any outstanding requests when terminating a worker. As this is controlled by the module loader, the approach I took here was to reject the promises and allow the moduleloader to shutdown. I am open to alternatives however. Differential Revision: https://phabricator.services.mozilla.com/D173290
This commit is contained in:
Родитель
6c5beed2e2
Коммит
2e8899ceb2
|
@ -997,7 +997,12 @@ ModuleLoaderBase::~ModuleLoaderBase() {
|
|||
|
||||
void ModuleLoaderBase::Shutdown() {
|
||||
CancelAndClearDynamicImports();
|
||||
MOZ_ASSERT(mFetchingModules.IsEmpty());
|
||||
|
||||
for (const auto& entry : mFetchingModules) {
|
||||
if (entry.GetData()) {
|
||||
entry.GetData()->Reject(NS_ERROR_FAILURE, __func__);
|
||||
}
|
||||
}
|
||||
|
||||
for (const auto& entry : mFetchedModules) {
|
||||
if (entry.GetData()) {
|
||||
|
@ -1005,6 +1010,7 @@ void ModuleLoaderBase::Shutdown() {
|
|||
}
|
||||
}
|
||||
|
||||
mFetchingModules.Clear();
|
||||
mFetchedModules.Clear();
|
||||
mGlobalObject = nullptr;
|
||||
mEventTarget = nullptr;
|
||||
|
|
Загрузка…
Ссылка в новой задаче