Bug 1180145, part 3 - Block resource timing reporting for channels that are tainted. r=jwatt

MozReview-Commit-ID: FdlbJ2YYMaG
This commit is contained in:
Jonathan Watt
2017-11-08 18:13:46 +00:00
parent 225e4aca25
commit d3027ccb8d

View File

@@ -141,6 +141,17 @@ PerformanceMainThread::AddEntry(nsIHttpChannel* channel,
originalURI->GetSpec(name);
NS_ConvertUTF8toUTF16 entryName(name);
bool reportTiming = true;
timedChannel->GetReportResourceTiming(&reportTiming);
if (!reportTiming) {
#ifdef DEBUG_jwatt
NS_WARNING(
nsPrintfCString("Not reporting CORS resource: %s", name.get()).get());
#endif
return;
}
// The nsITimedChannel argument will be used to gather all the timings.
// The nsIHttpChannel argument will be used to check if any cross-origin
// redirects occurred.