зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
733f875cc0
Коммит
e28898c446
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче