tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 092a9faecc5b939516e7fddaef4d5a37c7d90509
parent 29510a29713bfa516c810e26a7ddd72631145cb5
Author: Daniel Minor <dminor@mozilla.com>
Date:   Fri, 12 Dec 2025 14:12:35 +0000

Bug 1994828 - Track wasm mime type essence in ModuleLoadRequest; r=allstarschh

The only way we can distinguish between JavaScript and wasm modules is
using the mime type in the http response. This adds a field to track this
information in the load request, so we know later on if we should
attempt to compile the module as JavaScript or wasm.

Differential Revision: https://phabricator.services.mozilla.com/D270150

Diffstat:
Mjs/loader/ModuleLoadRequest.h | 11+++++++++++
1 file changed, 11 insertions(+), 0 deletions(-)

diff --git a/js/loader/ModuleLoadRequest.h b/js/loader/ModuleLoadRequest.h @@ -104,6 +104,12 @@ class ModuleLoadRequest final : public ScriptLoadRequest { void LoadFinished(); +#ifdef NIGHTLY_BUILD + void SetHasWasmMimeTypeEssence() { mHasWasmMimeTypeEssence = true; } + + bool HasWasmMimeTypeEssence() { return mHasWasmMimeTypeEssence; } +#endif + void SetErroredLoadingImports() { MOZ_ASSERT(IsDynamicImport()); MOZ_ASSERT(IsFetching() || IsCompiling()); @@ -120,6 +126,11 @@ class ModuleLoadRequest final : public ScriptLoadRequest { // Is this the top level request for a dynamic module import? const bool mIsDynamicImport; +#ifdef NIGHTLY_BUILD + // We can only distinguish JavaScript and Wasm modules by mime type essence. + bool mHasWasmMimeTypeEssence = false; +#endif + // A flag (for dynamic import) that indicates the module script is // successfully fetched and compiled, but its dependencies are failed to load. bool mErroredLoadingImports;