Bug 1800641 - Part 2: Add ScriptLoadRequest::Bytecode and let JSExecutionContext::Decode receive JS::TranscodeRange. r=nbp

Depends on D197839

Differential Revision: https://phabricator.services.mozilla.com/D197840
This commit is contained in:
Tooru Fujisawa
2024-01-08 14:57:36 +00:00
parent cac32b6d4d
commit 59f39b43f5
5 changed files with 18 additions and 23 deletions

View File

@@ -243,6 +243,14 @@ class ScriptLoadRequest
void SetBytecode();
JS::TranscodeRange Bytecode() const {
MOZ_ASSERT(IsBytecode());
const auto& bytecode = mScriptBytecode;
auto offset = mBytecodeOffset;
return JS::TranscodeRange(bytecode.begin() + offset,
bytecode.length() - offset);
}
mozilla::CORSMode CORSMode() const { return mFetchOptions->mCORSMode; }
void DropBytecodeCacheReferences();