tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 2a53c8b5c00f83dfc24c1eb2192171f4947ce0c1
parent 76d3a11be319860b8224d582c699cad18982aa07
Author: acreskeyMoz <acreskey@mozilla.com>
Date:   Mon, 20 Oct 2025 22:38:10 +0000

Bug 1993597 - Record zero values for time to request start in the Pageload event as they can occur with established connections r=denispal

Speculative and pre-established connections may yield zero or slightly negative timeToRequestStart timings.
We record these as zero to maintain consistent, non-negative timing data, while still capturing the impact of early connection establishment.

Differential Revision: https://phabricator.services.mozilla.com/D269271

Diffstat:
Mdom/base/Document.cpp | 6++++++
1 file changed, 6 insertions(+), 0 deletions(-)

diff --git a/dom/base/Document.cpp b/dom/base/Document.cpp @@ -2546,6 +2546,12 @@ void Document::AccumulatePageLoadTelemetry() { if (timeToRequestStart > zeroDuration) { mPageloadEventData.set_timeToRequestStart( static_cast<uint32_t>(timeToRequestStart.ToMilliseconds())); + } else { + // Speculative and pre-established connections may yield zero or + // slightly negative timeToRequestStart timings. We record these as zero + // to maintain consistent, non-negative timing data, while still + // capturing the impact of early connection establishment. + mPageloadEventData.set_timeToRequestStart(0); } }