Bug 1626335 - Don't treat any URI as third party for system principal r=baku,ckerschb

Differential Revision: https://phabricator.services.mozilla.com/D78151
This commit is contained in:
James Willcox 2020-06-09 08:46:02 +00:00
Родитель 2475b7008d
Коммит 59f798035c
1 изменённых файлов: 12 добавлений и 0 удалений

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

@ -556,6 +556,12 @@ nsresult BasePrincipal::CheckMayLoadHelper(nsIURI* aURI,
NS_IMETHODIMP
BasePrincipal::IsThirdPartyURI(nsIURI* aURI, bool* aRes) {
if (IsSystemPrincipal()) {
// Nothing is 3rd party to the system principal.
*aRes = false;
return NS_OK;
}
*aRes = true;
// If we do not have a URI its always 3rd party.
nsCOMPtr<nsIURI> prinURI;
@ -579,6 +585,12 @@ BasePrincipal::IsThirdPartyPrincipal(nsIPrincipal* aPrin, bool* aRes) {
}
NS_IMETHODIMP
BasePrincipal::IsThirdPartyChannel(nsIChannel* aChan, bool* aRes) {
if (IsSystemPrincipal()) {
// Nothing is 3rd party to the system principal.
*aRes = false;
return NS_OK;
}
nsCOMPtr<nsIURI> prinURI;
GetURI(getter_AddRefs(prinURI));
ThirdPartyUtil* thirdPartyUtil = ThirdPartyUtil::GetInstance();