commit 2c0430bd746ec5fca77f77564b6fb23b52355c31 parent 3a201a64a1bab9a09dbaa64d9444f5111d064d32 Author: Randell Jesup <rjesup@mozilla.com> Date: Thu, 4 Dec 2025 21:07:20 +0000 Bug 2003980: pass decodedBodySize down to the content process r=necko-reviewers,valentin This is needed because Dictionary-compressed resources (and items marked as dictionaries) are decompressed in the parent process Differential Revision: https://phabricator.services.mozilla.com/D275034 Diffstat:
5 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/netwerk/ipc/NeckoChannelParams.ipdlh b/netwerk/ipc/NeckoChannelParams.ipdlh @@ -603,6 +603,7 @@ struct ResourceTimingStructArgs { TimeStamp redirectEnd; uint64_t transferSize; uint64_t encodedBodySize; + uint64_t decodedBodySize; // Not actually part of resource timing, but not part of the transaction // timings either. These need to be passed to HttpChannelChild along with diff --git a/netwerk/protocol/http/HttpBaseChannel.cpp b/netwerk/protocol/http/HttpBaseChannel.cpp @@ -1885,6 +1885,7 @@ HttpBaseChannel::GetRequestSize(uint64_t* aRequestSize) { NS_IMETHODIMP HttpBaseChannel::GetDecodedBodySize(uint64_t* aDecodedBodySize) { + MutexAutoLock lock(mOnDataFinishedMutex); *aDecodedBodySize = mDecodedBodySize; return NS_OK; } diff --git a/netwerk/protocol/http/HttpChannelChild.cpp b/netwerk/protocol/http/HttpChannelChild.cpp @@ -892,6 +892,7 @@ void HttpChannelChild::ProcessOnStopRequest( MutexAutoLock lock(mOnDataFinishedMutex); mTransferSize = aTiming.transferSize(); mEncodedBodySize = aTiming.encodedBodySize(); + mDecodedBodySize = aTiming.decodedBodySize(); } if (StaticPrefs::network_send_OnDataFinished()) { diff --git a/netwerk/protocol/http/HttpChannelParent.cpp b/netwerk/protocol/http/HttpChannelParent.cpp @@ -1108,8 +1108,9 @@ static ResourceTimingStructArgs GetTimingAttributes(HttpBaseChannel* aChannel) { aChannel->GetEncodedBodySize(&size); args.encodedBodySize() = size; - // decodedBodySize can be computed in the child process so it doesn't need - // to be passed down. + + aChannel->GetDecodedBodySize(&size); + args.decodedBodySize() = size; aChannel->GetCacheReadStart(&timeStamp); args.cacheReadStart() = timeStamp; diff --git a/netwerk/protocol/http/HttpTransactionChild.cpp b/netwerk/protocol/http/HttpTransactionChild.cpp @@ -490,6 +490,7 @@ ResourceTimingStructArgs HttpTransactionChild::GetTimingAttributes() { args.responseEnd() = mTransaction->GetResponseEnd(); args.transferSize() = mTransaction->GetTransferSize(); args.encodedBodySize() = mLogicalOffset; + args.decodedBodySize() = 0; args.redirectStart() = mRedirectStart; args.redirectEnd() = mRedirectEnd; args.transferSize() = mTransaction->GetTransferSize();