Bug 1620928: Remove unecessary null checks for loadinfo within ReferrerInfo. r=baku

Differential Revision: https://phabricator.services.mozilla.com/D65935

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Christoph Kerschbaumer 2020-03-10 11:19:05 +00:00
Родитель 733f875cc0
Коммит e28898c446
1 изменённых файлов: 14 добавлений и 17 удалений

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

@ -191,24 +191,21 @@ ReferrerPolicy ReferrerInfo::GetDefaultReferrerPolicy(nsIHttpChannel* aChannel,
nsIURI* aURI,
bool privateBrowsing) {
bool thirdPartyTrackerIsolated = false;
nsCOMPtr<nsILoadInfo> loadInfo;
if (aChannel) {
loadInfo = aChannel->LoadInfo();
}
nsCOMPtr<nsICookieJarSettings> cjs;
if (loadInfo) {
if (aChannel && aURI) {
nsCOMPtr<nsILoadInfo> loadInfo = aChannel->LoadInfo();
nsCOMPtr<nsICookieJarSettings> cjs;
Unused << loadInfo->GetCookieJarSettings(getter_AddRefs(cjs));
}
if (!cjs) {
cjs = net::CookieJarSettings::Create();
}
if (aChannel && aURI && cjs->GetRejectThirdPartyTrackers()) {
uint32_t rejectedReason = 0;
thirdPartyTrackerIsolated =
!ContentBlocking::ShouldAllowAccessFor(aChannel, aURI, &rejectedReason);
// Here we intentionally do not notify about the rejection reason, if any
// in order to avoid this check to have any visible side-effects (e.g. a
// web console report.)
if (!cjs) {
cjs = net::CookieJarSettings::Create();
}
if (cjs->GetRejectThirdPartyTrackers()) {
uint32_t rejectedReason = 0;
thirdPartyTrackerIsolated = !ContentBlocking::ShouldAllowAccessFor(
aChannel, aURI, &rejectedReason);
// Here we intentionally do not notify about the rejection reason, if any
// in order to avoid this check to have any visible side-effects (e.g. a
// web console report.)
}
}
uint32_t defaultToUse;