Bug 1436400 - Part 4: Add ScriptLoader::BytecodeMimeTypeFor static method to get bytecode MIME type for given request. r=nbp
Module bytecode should use different MIME type, to avoid mixing up script/module bytecodes for single JS file. This patch adds a static method that simply returns the current bytecode MIME type. The later patch adds a new MIME type for module bytecode and modify the ScriptLoader::BytecodeMimeTypeFor method to return corresponding MIME type. Differential Revision: https://phabricator.services.mozilla.com/D140292
This commit is contained in:
@@ -305,7 +305,7 @@ nsresult ScriptLoadHandler::EnsureKnownDataType(
|
||||
if (cic) {
|
||||
nsAutoCString altDataType;
|
||||
cic->GetAlternativeDataType(altDataType);
|
||||
if (altDataType.Equals(nsContentUtils::JSBytecodeMimeType())) {
|
||||
if (altDataType.Equals(ScriptLoader::BytecodeMimeTypeFor(mRequest))) {
|
||||
mRequest->SetBytecode();
|
||||
TRACE_FOR_TEST(mRequest->mLoadContext->GetScriptElement(),
|
||||
"scriptloader_load_bytecode");
|
||||
|
||||
Reference in New Issue
Block a user