Bug 1396307 - Make sure we only set mRaceCacheWithNetwork to true when the feature is enabled r=michal
MozReview-Commit-ID: FrLjfuExmYV
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -3971,17 +3971,17 @@ nsHttpChannel::OpenCacheEntry(bool isHtt
NS_SUCCEEDED(rv) && !hasAltData && sizeInKb < sRCWNSmallResourceSizeKB) {
MaybeRaceCacheWithNetwork();
}
if (!mCacheOpenDelay) {
MOZ_ASSERT(NS_IsMainThread(), "Should be called on the main thread");
mCacheAsyncOpenCalled = true;
if (mNetworkTriggered) {
- mRaceCacheWithNetwork = true;
+ mRaceCacheWithNetwork = sRCWNEnabled;
}
rv = cacheStorage->AsyncOpenURI(openURI, extension, cacheEntryOpenFlags, this);
} else {
// We pass `this` explicitly as a parameter due to the raw pointer
// to refcounted object in lambda analysis.
mCacheOpenFunc = [openURI, extension, cacheEntryOpenFlags, cacheStorage] (nsHttpChannel* self) -> void {
MOZ_ASSERT(NS_IsMainThread(), "Should be called on the main thread");
self->mCacheAsyncOpenCalled = true;
@@ -9382,17 +9382,17 @@ nsHttpChannel::TriggerNetwork()
// for the cache callbacks.
if (mProxyRequest) {
LOG((" proxy request in progress. Delaying network trigger.\n"));
mWaitingForProxy = true;
return NS_OK;
}
if (mCacheAsyncOpenCalled && !mOnCacheAvailableCalled) {
- mRaceCacheWithNetwork = true;
+ mRaceCacheWithNetwork = sRCWNEnabled;
}
LOG((" triggering network\n"));
return TryHSTSPriming();
}
nsresult
nsHttpChannel::MaybeRaceCacheWithNetwork()