diff --git a/netwerk/base/nsLoadGroup.cpp b/netwerk/base/nsLoadGroup.cpp index 1208649c9378..d924337f25ae 100644 --- a/netwerk/base/nsLoadGroup.cpp +++ b/netwerk/base/nsLoadGroup.cpp @@ -825,7 +825,13 @@ nsLoadGroup::SetUserAgentOverrideCache(const nsACString & aUserAgentOverrideCach void nsLoadGroup::TelemetryReport() { - if (mDefaultLoadIsTimed) { + nsresult defaultStatus = NS_ERROR_INVALID_ARG; + // We should only report HTTP_PAGE_* telemetry if the defaultRequest was + // actually successful. + if (mDefaultLoadRequest) { + mDefaultLoadRequest->GetStatus(&defaultStatus); + } + if (mDefaultLoadIsTimed && NS_SUCCEEDED(defaultStatus)) { Telemetry::Accumulate(Telemetry::HTTP_REQUEST_PER_PAGE, mTimedRequests); if (mTimedRequests) { Telemetry::Accumulate(Telemetry::HTTP_REQUEST_PER_PAGE_FROM_CACHE, diff --git a/netwerk/protocol/http/NullHttpChannel.cpp b/netwerk/protocol/http/NullHttpChannel.cpp index 59da1a36b2ea..3c462457f702 100644 --- a/netwerk/protocol/http/NullHttpChannel.cpp +++ b/netwerk/protocol/http/NullHttpChannel.cpp @@ -552,7 +552,8 @@ NullHttpChannel::GetIsDocument(bool *aIsDocument) NS_IMETHODIMP NullHttpChannel::GetTimingEnabled(bool *aTimingEnabled) { - *aTimingEnabled = true; + // We don't want to report timing for null channels. + *aTimingEnabled = false; return NS_OK; }