Bug 1800496 - Re-introduce Cycle Collected LoadContextBase for Workers; r=jonco

The non-cycle collected LoadContextBase caused failures for Module Workers. This reverts that change

Differential Revision: https://phabricator.services.mozilla.com/D162214
This commit is contained in:
Yulia Startsev
2022-11-18 10:02:26 +00:00
parent 390fded5b8
commit 71eff5dd55
10 changed files with 38 additions and 104 deletions

View File

@@ -152,17 +152,6 @@ mozilla::dom::WorkerLoadContext* ScriptLoadRequest::GetWorkerLoadContext() {
return mLoadContext->AsWorkerContext();
}
already_AddRefed<mozilla::dom::WorkerLoadContext>
ScriptLoadRequest::StealWorkerLoadContext() {
MOZ_ASSERT(mLoadContext);
RefPtr<mozilla::dom::WorkerLoadContext> workerContext =
mLoadContext->AsWorkerContext();
// Break cycle.
mLoadContext->mRequest = nullptr;
mLoadContext = nullptr;
return workerContext.forget();
}
ModuleLoadRequest* ScriptLoadRequest::AsModuleRequest() {
MOZ_ASSERT(IsModuleRequest());
return static_cast<ModuleLoadRequest*>(this);