Bug 1356686: Put OMT decompression behind a pref r=necko-reviewers,valentin

Differential Revision: https://phabricator.services.mozilla.com/D204957
This commit is contained in:
Randell Jesup 2024-03-18 20:04:02 +00:00
parent 95c8ee2aa1
commit 57dfce801d
2 changed files with 7 additions and 1 deletions

View File

@ -13253,6 +13253,11 @@
value: "file,moz-gio"
mirror: never
# Enable off-main-thread decompression of network streams
- name: network.decompression_off_mainthread
type: bool
value: true
mirror: always
#---------------------------------------------------------------------------
# Prefs starting with "nglayout."

View File

@ -140,7 +140,8 @@ nsHTTPCompressConv::MaybeRetarget(nsIRequest* request) {
nsCOMPtr<nsISerialEventTarget> target;
rv = req->GetDeliveryTarget(getter_AddRefs(target));
if (NS_FAILED(rv) || !target || target->IsOnCurrentThread()) {
if ((NS_FAILED(rv) || !target || target->IsOnCurrentThread()) &&
StaticPrefs::network_decompression_off_mainthread()) {
// No retargetting was performed. Decompress off MainThread,
// and dispatch results back to MainThread
nsCOMPtr<nsISerialEventTarget> backgroundThread;