Bug 1408990 - Only add the entry to the performance object if the loading document's principal is the same as the triggering principal. r=bz, r=dragana

MozReview-Commit-ID: 7o8XKHioP1p
This commit is contained in:
Valentin Gosu 2017-10-28 00:15:01 +02:00
parent 210e82ed33
commit 3680a69516

View File

@ -4132,6 +4132,14 @@ HttpBaseChannel::GetPerformance()
return nullptr;
}
// We only add to the document's performance object if it has the same
// principal as the one triggering the load. This is to prevent navigations
// triggered _by_ the iframe from showing up in the parent document's
// performance entries if they have different origins.
if (!mLoadInfo->TriggeringPrincipal()->Equals(loadingDocument->NodePrincipal())) {
return nullptr;
}
nsCOMPtr<nsPIDOMWindowInner> innerWindow = loadingDocument->GetInnerWindow();
if (!innerWindow) {
return nullptr;