/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// aPerformanceTimingData and aPerformance must be non-null
PerformanceResourceTiming(
UniquePtr<PerformanceTimingData>&& aPerformanceTimingData,
Performance* aPerformance, const nsAString& aName);
DOMHighResTimeStamp RedirectStart(nsIPrincipal& aSubjectPrincipal, bool aEnsureSameOriginAndIgnoreTAO) const { // We have to check if all the redirect URIs whether had the same origin or // different origins with TAO headers set (since there is no check in // RedirectStartHighRes()) return ReportRedirectForCaller(aSubjectPrincipal,
aEnsureSameOriginAndIgnoreTAO)
? mTimingData->RedirectStartHighRes(mPerformance)
: 0;
}
DOMHighResTimeStamp RedirectEnd(nsIPrincipal& aSubjectPrincipal, bool aEnsureSameOriginAndIgnoreTAO) const { // We have to check if all the redirect URIs whether had the same origin or // different origins with TAO headers set (since there is no check in // RedirectEndHighRes()) return ReportRedirectForCaller(aSubjectPrincipal,
aEnsureSameOriginAndIgnoreTAO)
? mTimingData->RedirectEndHighRes(mPerformance)
: 0;
}
uint64_t TransferSize(nsIPrincipal& aSubjectPrincipal) const { constbool allowed =
!mTimingData->RedirectCountReal()
? TimingAllowedForCaller(aSubjectPrincipal)
: ReportRedirectForCaller(aSubjectPrincipal, false); if (!allowed) { return 0;
} // Resource is cached. if (!mTimingData->TransferSize()) { return 0;
} auto encodedBodySize = EncodedBodySize(aSubjectPrincipal); // The constant number added to transferSize replaces exposing the // total byte size of the HTTP headers, as that may expose the // presence of certain cookies. // https://github.com/w3c/resource-timing/issues/238 return encodedBodySize + 300;
}
// Check if caller has access to the bodyInfo of the request, per Fetch spec.
nsITimedChannel::BodyInfoAccess BodyInfoAccessAllowedForCaller(
nsIPrincipal& aCaller) const;
// Check if caller has access to cross-origin timings, either by the rules // from the spec, or based on addon permissions. bool TimingAllowedForCaller(nsIPrincipal& aCaller) const;
// Check if cross-origin redirects should be reported to the caller. bool ReportRedirectForCaller(nsIPrincipal& aCaller, bool aEnsureSameOriginAndIgnoreTAO) const;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.