Bug 1676490: Fix some confusing NS_WARN_IFs in non-failure cases. r=baku

Differential Revision: https://phabricator.services.mozilla.com/D96622
This commit is contained in:
Kris Maglione 2021-01-08 20:15:36 +00:00
parent 874e9acf8e
commit 4455a70039

View File

@ -762,7 +762,7 @@ bool BlobURLProtocolHandler::GetDataEntry(
// principal and which is never mutated to have a non-zero
// mPrivateBrowsingId or container.
if (NS_WARN_IF(!aLoadingPrincipal ||
if ((NS_WARN_IF(!aLoadingPrincipal) ||
!aLoadingPrincipal->IsSystemPrincipal()) &&
NS_WARN_IF(!ChromeUtils::IsOriginAttributesEqualIgnoringFPD(
aOriginAttributes,
@ -770,14 +770,14 @@ bool BlobURLProtocolHandler::GetDataEntry(
return false;
}
if (!aTriggeringPrincipal->Subsumes(info->mPrincipal)) {
if (NS_WARN_IF(!aTriggeringPrincipal->Subsumes(info->mPrincipal))) {
return false;
}
// BlobURLs are openable on the same agent-cluster-id only.
if (StaticPrefs::privacy_partition_bloburl_per_agent_cluster() &&
aAgentClusterId.isSome() && info->mAgentClusterId.isSome() &&
!aAgentClusterId.value().Equals(info->mAgentClusterId.value())) {
NS_WARN_IF(!aAgentClusterId->Equals(info->mAgentClusterId.value()))) {
return false;
}