mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-22 15:17:29 +09:00
parent
231685e644
commit
b0fe82b857
3 changed files with 27 additions and 4 deletions
|
|
@ -46,6 +46,23 @@ PerformanceTiming::PerformanceTiming(Performance* aPerformance,
|
||||||
mReportCrossOriginRedirect = mTimingAllowed && redirectsPassCheck;
|
mReportCrossOriginRedirect = mTimingAllowed && redirectsPassCheck;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mSecureConnection = false;
|
||||||
|
nsCOMPtr<nsIURI> uri;
|
||||||
|
if (aHttpChannel) {
|
||||||
|
aHttpChannel->GetURI(getter_AddRefs(uri));
|
||||||
|
} else {
|
||||||
|
nsCOMPtr<nsIHttpChannel> httpChannel = do_QueryInterface(aChannel);
|
||||||
|
if (httpChannel) {
|
||||||
|
httpChannel->GetURI(getter_AddRefs(uri));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (uri) {
|
||||||
|
nsresult rv = uri->SchemeIs("https", &mSecureConnection);
|
||||||
|
if (NS_FAILED(rv)) {
|
||||||
|
mSecureConnection = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
InitializeTimingInfo(aChannel);
|
InitializeTimingInfo(aChannel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -89,7 +106,8 @@ PerformanceTiming::InitializeTimingInfo(nsITimedChannel* aChannel)
|
||||||
mConnectStart = mAsyncOpen;
|
mConnectStart = mAsyncOpen;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mSecureConnectionStart.IsNull() && mSecureConnectionStart < mAsyncOpen) {
|
if (mSecureConnection && !mSecureConnectionStart.IsNull() &&
|
||||||
|
mSecureConnectionStart < mAsyncOpen) {
|
||||||
mSecureConnectionStart = mAsyncOpen;
|
mSecureConnectionStart = mAsyncOpen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -307,8 +325,11 @@ PerformanceTiming::SecureConnectionStartHighRes()
|
||||||
if (!nsContentUtils::IsPerformanceTimingEnabled() || !IsInitialized()) {
|
if (!nsContentUtils::IsPerformanceTimingEnabled() || !IsInitialized()) {
|
||||||
return mZeroTime;
|
return mZeroTime;
|
||||||
}
|
}
|
||||||
return mSecureConnectionStart.IsNull() ? mZeroTime
|
return !mSecureConnection
|
||||||
: TimerClamping::ReduceMsTimeValue(TimeStampToDOMHighRes(mSecureConnectionStart));
|
? 0 // We use 0 here, because mZeroTime is sometimes set to the navigation
|
||||||
|
// start time.
|
||||||
|
: (mSecureConnectionStart.IsNull() ? mZeroTime
|
||||||
|
: TimerClamping::ReduceMsTimeValue(TimeStampToDOMHighRes(mSecureConnectionStart)));
|
||||||
}
|
}
|
||||||
|
|
||||||
DOMTimeMilliSec
|
DOMTimeMilliSec
|
||||||
|
|
|
||||||
|
|
@ -274,6 +274,8 @@ private:
|
||||||
// redirectEnd attributes. It is false if there were no redirects, or if
|
// redirectEnd attributes. It is false if there were no redirects, or if
|
||||||
// any of the responses didn't pass the timing-allow-check
|
// any of the responses didn't pass the timing-allow-check
|
||||||
bool mReportCrossOriginRedirect;
|
bool mReportCrossOriginRedirect;
|
||||||
|
|
||||||
|
bool mSecureConnection;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace dom
|
} // namespace dom
|
||||||
|
|
|
||||||
|
|
@ -263,7 +263,7 @@ var steps = [
|
||||||
performance.measure("test", n);
|
performance.measure("test", n);
|
||||||
ok(true, "Measure created from reserved name as starting time: " + n);
|
ok(true, "Measure created from reserved name as starting time: " + n);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
ok(["redirectStart", "redirectEnd", "unloadEventStart", "unloadEventEnd", "loadEventEnd"].indexOf(n) >= 0,
|
ok(["redirectStart", "redirectEnd", "unloadEventStart", "unloadEventEnd", "loadEventEnd", "secureConnectionStart"].indexOf(n) >= 0,
|
||||||
"Measure created from reserved name as starting time: " + n + " and threw expected error");
|
"Measure created from reserved name as starting time: " + n + " and threw expected error");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue