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
Родитель abe1a2a6c4
Коммит 25f221f47d
1 изменённых файлов: 11 добавлений и 0 удалений

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

@ -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.