commit 7f5f39e4ba09f94f6dc4aec14dc0fe3ed5980e2a
parent 58699211928a5ff3b7edffdeccf9f916f591d5d0
Author: iulian moraru <imoraru@mozilla.com>
Date: Tue, 11 Nov 2025 04:25:42 +0200
Revert "Bug 1946429 - Disable RCWN (Race Cache With Network) for devices with SSDs r=jesup,necko-reviewers,valentin" for causing wpt failures on fedcm-disconnect-iframe.sub.https.html.
This reverts commit f450fe1ecfd2086fdd5333a805fcaf946ba4720b.
Diffstat:
2 files changed, 7 insertions(+), 47 deletions(-)
diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml
@@ -13412,17 +13412,14 @@
value: false
mirror: always
-# If we should attempt to race the cache with network.
-# See also race_with_non_ssd for auto-enable behavior on Windows non-SSD drives.
+# If we should attempt to race the cache and network.
- name: network.http.rcwn.enabled
type: bool
+#if defined(ANDROID)
value: false
- mirror: always
-
-# If we should attempt to race the cache with network for non-SSD drives (Windows only).
-- name: network.http.rcwn.race_with_non_ssd
- type: bool
+#else
value: true
+#endif
mirror: always
- name: network.http.rcwn.cache_queue_normal_threshold
diff --git a/netwerk/protocol/http/nsHttpChannel.cpp b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -104,9 +104,6 @@
#include "mozilla/dom/ReferrerInfo.h"
#include "mozilla/glean/DomSecurityMetrics.h"
#include "mozilla/Telemetry.h"
-#include "mozilla/Services.h"
-#include "nsISystemInfo.h"
-#include "mozilla/Components.h"
#include "AlternateServices.h"
#include "NetworkMarker.h"
#include "nsIDNSRecord.h"
@@ -4640,41 +4637,6 @@ nsresult nsHttpChannel::OpenCacheEntry(bool isHttps) {
return OpenCacheEntryInternal(isHttps);
}
-#ifdef XP_WIN
-static mozilla::Maybe<bool> sHasSSD;
-#endif
-
-static bool RCWNEnabled() {
- // State table for RCWN logic (race_with_non_ssd is Windows only):
- // network.http.rcwn.enabled | Device | race_with_non_ssd | Result
- // true | any | any | Enabled
- // false | SSD | any | Disabled
- // false | non-SSD | true | Enabled
- // false | non-SSD | false | Disabled
-
- bool rcwnEnabled = StaticPrefs::network_http_rcwn_enabled();
-#ifdef XP_WIN
- if (!rcwnEnabled) {
- if (sHasSSD.isNothing()) {
- bool hasSSD = true;
- nsCOMPtr<nsIPropertyBag2> sysInfo =
- mozilla::components::SystemInfo::Service();
- if (NS_SUCCEEDED(sysInfo->GetPropertyAsBool(u"hasSSD"_ns, &hasSSD))) {
- sHasSSD = Some(hasSSD);
- } else {
- // Failed to detect, assume SSD (conservative default)
- sHasSSD = Some(true);
- }
- }
- if (sHasSSD.isSome() && !sHasSSD.value()) {
- // For non-SSD devices, check the non-SSD-specific preference
- rcwnEnabled = StaticPrefs::network_http_rcwn_race_with_non_ssd();
- }
- }
-#endif
- return rcwnEnabled;
-}
-
nsresult nsHttpChannel::OpenCacheEntryInternal(bool isHttps) {
nsresult rv;
@@ -4809,7 +4771,8 @@ nsresult nsHttpChannel::OpenCacheEntryInternal(bool isHttps) {
maybeRCWN = false;
}
- if ((mNetworkTriggerDelay || RCWNEnabled()) && maybeRCWN && mAllowRCWN) {
+ if ((mNetworkTriggerDelay || StaticPrefs::network_http_rcwn_enabled()) &&
+ maybeRCWN && mAllowRCWN) {
bool hasAltData = false;
uint32_t sizeInKb = 0;
rv = cacheStorage->GetCacheIndexEntryAttrs(
@@ -4827,7 +4790,7 @@ nsresult nsHttpChannel::OpenCacheEntryInternal(bool isHttps) {
if (!mCacheOpenDelay) {
MOZ_ASSERT(NS_IsMainThread(), "Should be called on the main thread");
if (mNetworkTriggered) {
- mRaceCacheWithNetwork = RCWNEnabled();
+ mRaceCacheWithNetwork = StaticPrefs::network_http_rcwn_enabled();
}
rv = cacheStorage->AsyncOpenURI(mCacheEntryURI, mCacheIdExtension,
cacheEntryOpenFlags, this);