Bug 1487113 - Add pref javascript.options.wasm_caching. r=necko-reviewers,valentin

Differential Revision: https://phabricator.services.mozilla.com/D27101
This commit is contained in:
Yury Delendik
2021-09-17 12:16:24 +00:00
parent b81b8b0b2e
commit 62105cd587
2 changed files with 7 additions and 1 deletions

View File

@@ -42,6 +42,7 @@
#include "mozilla/StaticPrefs_browser.h"
#include "mozilla/StaticPrefs_network.h"
#include "mozilla/StaticPrefs_privacy.h"
#include "mozilla/StaticPrefs_javascript.h"
#include "mozilla/Unused.h"
#include "Fetch.h"
@@ -826,7 +827,7 @@ nsresult FetchDriver::HttpFetch(
if (mRequest->GetIntegrity().IsEmpty()) {
MOZ_ASSERT(!FetchUtil::WasmAltDataType.IsEmpty());
nsCOMPtr<nsICacheInfoChannel> cic = do_QueryInterface(chan);
if (cic) {
if (cic && StaticPrefs::javascript_options_wasm_caching()) {
cic->PreferAlternativeDataType(
FetchUtil::WasmAltDataType, nsLiteralCString(WASM_CONTENT_TYPE),
nsICacheInfoChannel::PreferredAlternativeDataDeliveryType::