From 644e9db1092df1477b1facc52cd3ee45ebd13040 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Thu, 1 Mar 2018 11:52:50 +0100 Subject: DevTools - network - implement the secureConnectionStart property for the PerformanceTiming https://github.com/MoonchildProductions/moebius/pull/116 ("/testing" and "/toolkit" in in the previous commit) --- netwerk/protocol/http/NullHttpTransaction.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'netwerk/protocol/http/NullHttpTransaction.cpp') diff --git a/netwerk/protocol/http/NullHttpTransaction.cpp b/netwerk/protocol/http/NullHttpTransaction.cpp index 965ffcc2c..bb32a8098 100644 --- a/netwerk/protocol/http/NullHttpTransaction.cpp +++ b/netwerk/protocol/http/NullHttpTransaction.cpp @@ -162,6 +162,30 @@ void NullHttpTransaction::OnTransportStatus(nsITransport* transport, nsresult status, int64_t progress) { + if (status == NS_NET_STATUS_RESOLVING_HOST) { + if (mTimings.domainLookupStart.IsNull()) { + mTimings.domainLookupStart = TimeStamp::Now(); + } + } else if (status == NS_NET_STATUS_RESOLVED_HOST) { + if (mTimings.domainLookupEnd.IsNull()) { + mTimings.domainLookupEnd = TimeStamp::Now(); + } + } else if (status == NS_NET_STATUS_CONNECTING_TO) { + if (mTimings.connectStart.IsNull()) { + mTimings.connectStart = TimeStamp::Now(); + } + } else if (status == NS_NET_STATUS_CONNECTED_TO) { + if (mTimings.connectEnd.IsNull()) { + mTimings.connectEnd = TimeStamp::Now(); + } + } else if (status == NS_NET_STATUS_TLS_HANDSHAKE_ENDED) { + if (mTimings.secureConnectionStart.IsNull() && + !mTimings.connectEnd.IsNull()) { + mTimings.secureConnectionStart = mTimings.connectEnd; + } + mTimings.connectEnd = TimeStamp::Now();; + } + if (mActivityDistributor) { NS_DispatchToMainThread(new CallObserveActivity(mActivityDistributor, mConnectionInfo->GetOrigin(), -- cgit v1.2.3