Bug 1525025 - Always update domainLookup time in OnStopRequest r=valentin,necko-reviewers

Currently the domainLookup time is updated in OnLookupComplete, this
is problematic because since the DNS prefetch is racy, we are unable
to tell if it's a persistent connection, and we don't want to update
domainLookup if it's a persistent connection.

This patch stops updating it in OnLookupComplete to only update
it in OnStopRequest.

Differential Revision: https://phabricator.services.mozilla.com/D88070
This commit is contained in:
Sean Feng 2020-08-26 15:26:25 +00:00
Родитель 741f066b9a
Коммит 929537b45b
6 изменённых файлов: 2 добавлений и 62 удалений

Просмотреть файл

@ -481,7 +481,7 @@ DOMHighResTimeStamp PerformanceTimingData::SecureConnectionStartHighRes(
// navigation start time.
}
if (mSecureConnectionStart.IsNull()) {
return mZeroTime;
return ConnectStartHighRes(aPerformance);
}
DOMHighResTimeStamp rawValue =
TimeStampToDOMHighRes(aPerformance, mSecureConnectionStart);

Просмотреть файл

@ -8010,6 +8010,7 @@ nsHttpChannel::OnStopRequest(nsIRequest* request, nsresult status) {
mTransactionTimings.domainLookupStart = mDNSPrefetch->StartTimestamp();
mTransactionTimings.domainLookupEnd = mDNSPrefetch->EndTimestamp();
}
mDNSPrefetch = nullptr;
// handle auth retry...
if (authRetry) {
@ -9228,20 +9229,6 @@ nsHttpChannel::OnLookupComplete(nsICancelable* request, nsIDNSRecord* rec,
static_cast<uint32_t>(status), !!httpSSVCRecord));
if (!httpSSVCRecord) {
// We no longer need the dns prefetch object. Note: mDNSPrefetch could be
// validly null if OnStopRequest has already been called.
// We only need the domainLookup timestamps when not loading from cache
if (mDNSPrefetch && mDNSPrefetch->TimingsValid() && mTransaction) {
TimeStamp connectStart = mTransaction->GetConnectStart();
TimeStamp requestStart = mTransaction->GetRequestStart();
// We only set the domainLookup timestamps if we're not using a
// persistent connection.
if (requestStart.IsNull() && connectStart.IsNull()) {
mTransaction->SetDomainLookupStart(mDNSPrefetch->StartTimestamp());
mTransaction->SetDomainLookupEnd(mDNSPrefetch->EndTimestamp());
}
}
// Unset DNS cache refresh if it was requested,
if (mCaps & NS_HTTP_REFRESH_DNS) {
mCaps &= ~NS_HTTP_REFRESH_DNS;

Просмотреть файл

@ -1,10 +0,0 @@
[resource_connection_reuse.html]
disabled: https://bugzilla.mozilla.org/show_bug.cgi?id=1331948
[connectStart and fetchStart should be the same]
expected:
if not debug and e10s and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL
[connectEnd and fetchStart should be the same]
expected:
if not debug and e10s and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL

Просмотреть файл

@ -1,2 +0,0 @@
[resource_connection_reuse.https.html]
disabled: Bug 1523562

Просмотреть файл

@ -1,18 +0,0 @@
[resource_connection_reuse_mixed_content.html]
disabled: Bug 1523562
[secureConnectionStart and fetchStart should be the same]
expected: FAIL
[domainLookupEnd and fetchStart should be the same]
expected: FAIL
[connectStart and fetchStart should be the same]
expected: FAIL
[domainLookupStart and fetchStart should be the same]
expected: FAIL
[connectEnd and fetchStart should be the same]
expected: FAIL

Просмотреть файл

@ -1,17 +0,0 @@
[resource_connection_reuse_mixed_content_redirect.html]
disabled: Bug 1525025
[secureConnectionStart and fetchStart should be the same]
expected: FAIL
[domainLookupEnd and fetchStart should be the same]
expected: FAIL
[connectStart and fetchStart should be the same]
expected: FAIL
[domainLookupStart and fetchStart should be the same]
expected: FAIL
[connectEnd and fetchStart should be the same]
expected: FAIL