Bug 1803268 - Minor clean-up in nsScreen::ShouldResistFingerprinting(). r=smaug

This doesn't change behavior but it's cleaner, and while I was near that
code...

Differential Revision: https://phabricator.services.mozilla.com/D163505
This commit is contained in:
Emilio Cobos Álvarez
2022-11-30 19:03:38 +00:00
parent bf84df153e
commit 6dce0836c0

View File

@@ -224,10 +224,7 @@ nsresult nsScreen::GetWindowInnerRect(CSSIntRect& aRect) {
}
bool nsScreen::ShouldResistFingerprinting() const {
bool resist = false;
nsCOMPtr<nsPIDOMWindowInner> owner = GetOwner();
if (owner) {
resist = nsContentUtils::ShouldResistFingerprinting(owner->GetDocShell());
}
return resist;
return owner &&
nsGlobalWindowInner::Cast(owner)->ShouldResistFingerprinting();
}