Bug 1931514 - Make sure mAsycOpenTime is not null r=necko-reviewers,kershaw

Differential Revision: https://phabricator.services.mozilla.com/D229339
This commit is contained in:
Valentin Gosu 2024-11-20 20:53:50 +00:00
parent 89a3a509a6
commit ca1c1654a1

View File

@ -7063,10 +7063,6 @@ nsresult nsHttpChannel::BeginConnect() {
static_cast<uint32_t>(rv))); static_cast<uint32_t>(rv)));
} }
// If TimingEnabled flag is not set after OnModifyRequest() then
// clear the already recorded AsyncOpen value for consistency.
if (!LoadTimingEnabled()) mAsyncOpenTime = TimeStamp();
// if this somehow fails we can go on without it // if this somehow fails we can go on without it
Unused << gHttpHandler->AddConnectionHeader(&mRequestHead, mCaps); Unused << gHttpHandler->AddConnectionHeader(&mRequestHead, mCaps);
@ -8289,6 +8285,7 @@ static void RecordHTTPSUpgradeTelemetry(nsIURI* aURI, nsILoadInfo* aLoadInfo) {
NS_IMETHODIMP NS_IMETHODIMP
nsHttpChannel::OnStopRequest(nsIRequest* request, nsresult status) { nsHttpChannel::OnStopRequest(nsIRequest* request, nsresult status) {
MOZ_ASSERT(!mAsyncOpenTime.IsNull());
AUTO_PROFILER_LABEL("nsHttpChannel::OnStopRequest", NETWORK); AUTO_PROFILER_LABEL("nsHttpChannel::OnStopRequest", NETWORK);
LOG(("nsHttpChannel::OnStopRequest [this=%p request=%p status=%" PRIx32 "]\n", LOG(("nsHttpChannel::OnStopRequest [this=%p request=%p status=%" PRIx32 "]\n",