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-14 20:12:52 +00:00
parent 564b18936f
commit f03ccb4ccd
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::

View File

@ -6026,6 +6026,11 @@
value: true
mirror: always
- name: javascript.options.wasm_caching
type: bool
value: true
mirror: always
# The amount of time we wait between a request to GC (due to leaving a page) and doing the actual GC, in ms.
- name: javascript.options.gc_delay
type: uint32_t