зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1759881 - Part 5: Remove microtask checkpoints from the module loader in couple of places r=smaug
This removes the microtask checkpoint when instantiating modules and moves the one when creating a module script to the the script loader. Differential Revision: https://phabricator.services.mozilla.com/D141252
This commit is contained in:
Родитель
da0e34487e
Коммит
54129e0662
|
@ -148,8 +148,6 @@ nsresult nsJSUtils::ModuleInstantiate(JSContext* aCx,
|
|||
|
||||
MOZ_ASSERT(aCx == nsContentUtils::GetCurrentJSContext());
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
MOZ_ASSERT(CycleCollectedJSContext::Get() &&
|
||||
CycleCollectedJSContext::Get()->MicroTaskLevel());
|
||||
|
||||
NS_ENSURE_TRUE(xpc::Scriptability::Get(aModule).Allowed(), NS_OK);
|
||||
|
||||
|
|
|
@ -1106,6 +1106,13 @@ bool ScriptLoader::ProcessInlineScript(nsIScriptElement* aElement,
|
|||
}
|
||||
}
|
||||
|
||||
{
|
||||
// We must perform a microtask checkpoint when inserting script elements
|
||||
// as specified by: https://html.spec.whatwg.org/#parsing-main-incdata
|
||||
// For the non-inline module cases this happens in ProcessRequest.
|
||||
mozilla::nsAutoMicroTask mt;
|
||||
}
|
||||
|
||||
nsresult rv = mModuleLoader->ProcessFetchedModuleSource(modReq);
|
||||
if (NS_FAILED(rv)) {
|
||||
ReportErrorToConsole(modReq, rv);
|
||||
|
|
|
@ -241,8 +241,6 @@ nsresult ModuleLoaderBase::CreateModuleScript(ModuleLoadRequest* aRequest) {
|
|||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
mozilla::nsAutoMicroTask mt;
|
||||
|
||||
mozilla::dom::AutoJSAPI jsapi;
|
||||
if (!jsapi.Init(globalObject)) {
|
||||
return NS_ERROR_FAILURE;
|
||||
|
@ -688,7 +686,6 @@ bool ModuleLoaderBase::InstantiateModuleTree(ModuleLoadRequest* aRequest) {
|
|||
|
||||
MOZ_ASSERT(moduleScript->ModuleRecord());
|
||||
|
||||
mozilla::nsAutoMicroTask mt;
|
||||
mozilla::dom::AutoJSAPI jsapi;
|
||||
if (NS_WARN_IF(!jsapi.Init(moduleScript->ModuleRecord()))) {
|
||||
return false;
|
||||
|
|
Загрузка…
Ссылка в новой задаче