From 604a6aa077608e092fc62f8f03cd58d4f7dcfa9b Mon Sep 17 00:00:00 2001 From: Yulia Startsev Date: Fri, 22 Apr 2022 13:24:10 +0000 Subject: [PATCH] Bug 1763372 - address new issues in the hybrid build; r=jonco Depends on D143036 Differential Revision: https://phabricator.services.mozilla.com/D143068 --- dom/script/ScriptLoadContext.cpp | 2 +- js/loader/ModuleLoadRequest.cpp | 8 +++++--- js/loader/ModuleLoadRequest.h | 3 ++- js/loader/ModuleLoaderBase.cpp | 1 + 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/dom/script/ScriptLoadContext.cpp b/dom/script/ScriptLoadContext.cpp index 2f0e75d0ead4..b13a1a1393dc 100644 --- a/dom/script/ScriptLoadContext.cpp +++ b/dom/script/ScriptLoadContext.cpp @@ -14,8 +14,8 @@ #include "js/OffThreadScriptCompilation.h" #include "js/SourceText.h" -#include "js/loader/ScriptLoadRequest.h" #include "js/loader/LoadContextBase.h" +#include "js/loader/ModuleLoadRequest.h" #include "ScriptLoadContext.h" #include "ModuleLoadRequest.h" diff --git a/js/loader/ModuleLoadRequest.cpp b/js/loader/ModuleLoadRequest.cpp index 7abc4196ccb2..0b0416970f03 100644 --- a/js/loader/ModuleLoadRequest.cpp +++ b/js/loader/ModuleLoadRequest.cpp @@ -7,8 +7,10 @@ #include "ModuleLoadRequest.h" #include "mozilla/HoldDropJSObjects.h" +#include "mozilla/dom/ScriptLoadContext.h" #include "LoadedScript.h" +#include "LoadContextBase.h" #include "ModuleLoaderBase.h" namespace JS::loader { @@ -55,9 +57,9 @@ VisitedURLSet* ModuleLoadRequest::NewVisitedSetForTopLevelImport(nsIURI* aURI) { ModuleLoadRequest::ModuleLoadRequest( nsIURI* aURI, ScriptFetchOptions* aFetchOptions, const mozilla::dom::SRIMetadata& aIntegrity, nsIURI* aReferrer, - mozilla::dom::ScriptLoadContext* aContext, bool aIsTopLevel, - bool aIsDynamicImport, ModuleLoaderBase* aLoader, - VisitedURLSet* aVisitedSet, ModuleLoadRequest* aRootModule) + LoadContextBase* aContext, bool aIsTopLevel, bool aIsDynamicImport, + ModuleLoaderBase* aLoader, VisitedURLSet* aVisitedSet, + ModuleLoadRequest* aRootModule) : ScriptLoadRequest(ScriptKind::eModule, aURI, aFetchOptions, aIntegrity, aReferrer, aContext), mIsTopLevel(aIsTopLevel), diff --git a/js/loader/ModuleLoadRequest.h b/js/loader/ModuleLoadRequest.h index 92fe35c311bc..fb1b39391d70 100644 --- a/js/loader/ModuleLoadRequest.h +++ b/js/loader/ModuleLoadRequest.h @@ -7,6 +7,7 @@ #ifndef js_loader_ModuleLoadRequest_h #define js_loader_ModuleLoadRequest_h +#include "LoadContextBase.h" #include "ScriptLoadRequest.h" #include "ModuleLoaderBase.h" #include "mozilla/Assertions.h" @@ -52,7 +53,7 @@ class ModuleLoadRequest final : public ScriptLoadRequest { ModuleLoadRequest(nsIURI* aURI, ScriptFetchOptions* aFetchOptions, const SRIMetadata& aIntegrity, nsIURI* aReferrer, - mozilla::dom::ScriptLoadContext* aContext, bool aIsTopLevel, + LoadContextBase* aContext, bool aIsTopLevel, bool aIsDynamicImport, ModuleLoaderBase* aLoader, VisitedURLSet* aVisitedSet, ModuleLoadRequest* aRootModule); diff --git a/js/loader/ModuleLoaderBase.cpp b/js/loader/ModuleLoaderBase.cpp index d0985732452d..d217ac9f0b75 100644 --- a/js/loader/ModuleLoaderBase.cpp +++ b/js/loader/ModuleLoaderBase.cpp @@ -20,6 +20,7 @@ #include "js/SourceText.h" #include "mozilla/BasePrincipal.h" #include "mozilla/dom/AutoEntryScript.h" +#include "mozilla/dom/ScriptLoadContext.h" #include "mozilla/CycleCollectedJSContext.h" // nsAutoMicroTask #include "mozilla/Preferences.h" #include "nsContentUtils.h"