mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-04 23:08:39 +09:00
DevTools - network - implement the secureConnectionStart property for the PerformanceTiming
https://github.com/MoonchildProductions/moebius/pull/116 ("/testing" and "/toolkit" in in the previous commit)
This commit is contained in:
parent
38e95f9e35
commit
54f2e6eafd
32 changed files with 263 additions and 13 deletions
|
|
@ -63,12 +63,40 @@ PerformanceTiming::InitializeTimingInfo(nsITimedChannel* aChannel)
|
|||
aChannel->GetDomainLookupStart(&mDomainLookupStart);
|
||||
aChannel->GetDomainLookupEnd(&mDomainLookupEnd);
|
||||
aChannel->GetConnectStart(&mConnectStart);
|
||||
aChannel->GetSecureConnectionStart(&mSecureConnectionStart);
|
||||
aChannel->GetConnectEnd(&mConnectEnd);
|
||||
aChannel->GetRequestStart(&mRequestStart);
|
||||
aChannel->GetResponseStart(&mResponseStart);
|
||||
aChannel->GetCacheReadStart(&mCacheReadStart);
|
||||
aChannel->GetResponseEnd(&mResponseEnd);
|
||||
aChannel->GetCacheReadEnd(&mCacheReadEnd);
|
||||
|
||||
// the performance timing api essentially requires that the event timestamps
|
||||
// are >= asyncOpen().. but in truth the browser engages in a number of
|
||||
// speculative activities that sometimes mean connections and lookups begin
|
||||
// earlier. Workaround that here by just using asyncOpen as the minimum
|
||||
// timestamp for dns and connection info.
|
||||
if (!mAsyncOpen.IsNull()) {
|
||||
if (!mDomainLookupStart.IsNull() && mDomainLookupStart < mAsyncOpen) {
|
||||
mDomainLookupStart = mAsyncOpen;
|
||||
}
|
||||
|
||||
if (!mDomainLookupEnd.IsNull() && mDomainLookupEnd < mAsyncOpen) {
|
||||
mDomainLookupEnd = mAsyncOpen;
|
||||
}
|
||||
|
||||
if (!mConnectStart.IsNull() && mConnectStart < mAsyncOpen) {
|
||||
mConnectStart = mAsyncOpen;
|
||||
}
|
||||
|
||||
if (!mSecureConnectionStart.IsNull() && mSecureConnectionStart < mAsyncOpen) {
|
||||
mSecureConnectionStart = mAsyncOpen;
|
||||
}
|
||||
|
||||
if (!mConnectEnd.IsNull() && mConnectEnd < mAsyncOpen) {
|
||||
mConnectEnd = mAsyncOpen;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -273,6 +301,22 @@ PerformanceTiming::ConnectStart()
|
|||
return static_cast<int64_t>(ConnectStartHighRes());
|
||||
}
|
||||
|
||||
DOMHighResTimeStamp
|
||||
PerformanceTiming::SecureConnectionStartHighRes()
|
||||
{
|
||||
if (!nsContentUtils::IsPerformanceTimingEnabled() || !IsInitialized()) {
|
||||
return mZeroTime;
|
||||
}
|
||||
return mSecureConnectionStart.IsNull() ? mZeroTime
|
||||
: TimeStampToDOMHighRes(mSecureConnectionStart);
|
||||
}
|
||||
|
||||
DOMTimeMilliSec
|
||||
PerformanceTiming::SecureConnectionStart()
|
||||
{
|
||||
return static_cast<int64_t>(SecureConnectionStartHighRes());
|
||||
}
|
||||
|
||||
DOMHighResTimeStamp
|
||||
PerformanceTiming::ConnectEndHighRes()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue