Bug 1751678 - Make FetchStart uses StarTime when TAO check fails for PerformanceResourceTiming r=smaug

Given the recent Fetch spec updates, Step 8.1 in
https://fetch.spec.whatwg.org/#finalize-and-report-timing specifies
that start time(StartTime) and post-redirect start time(FetchStart) should
be start time when TAO check fails.

Differential Revision: https://phabricator.services.mozilla.com/D141366
This commit is contained in:
Sean Feng 2022-03-18 16:08:12 +00:00
Родитель d70a78efc1
Коммит cb38883dfa
4 изменённых файлов: 8 добавлений и 14 удалений

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

@ -41,6 +41,13 @@ PerformanceResourceTiming::PerformanceResourceTiming(
PerformanceResourceTiming::~PerformanceResourceTiming() = default;
DOMHighResTimeStamp PerformanceResourceTiming::FetchStart() const {
if (mTimingData->TimingAllowed()) {
return mTimingData->FetchStartHighRes(mPerformance);
}
return StartTime();
}
DOMHighResTimeStamp PerformanceResourceTiming::StartTime() const {
// Force the start time to be the earliest of:
// - RedirectStart

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

@ -56,9 +56,7 @@ class PerformanceResourceTiming : public PerformanceEntry {
return mTimingData->WorkerStartHighRes(mPerformance);
}
DOMHighResTimeStamp FetchStart() const {
return mTimingData->FetchStartHighRes(mPerformance);
}
DOMHighResTimeStamp FetchStart() const;
DOMHighResTimeStamp RedirectStart(Maybe<nsIPrincipal*>& aSubjectPrincipal,
bool aEnsureSameOriginAndIgnoreTAO) const {

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

@ -1,4 +0,0 @@
[cross-origin-start-end-time-with-redirects.html]
[Verify that cross-origin resources don't implicitly expose their redirect timings]
expected: FAIL

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

@ -1,7 +0,0 @@
[object-not-found-after-cross-origin-redirect.html]
expected:
if (os == "win") and fission: OK
if os == "mac": OK
[OK, ERROR]
[Verify that cross-origin object resources don't implicitly expose their redirect timings]
expected: FAIL