Bug 1813081 - Remove ScreenOrientation::ShouldResistFingerprinting. r=tjr

Differential Revision: https://phabricator.services.mozilla.com/D168117
This commit is contained in:
Tom Schuster 2023-01-30 09:41:25 +00:00
parent 90cf68390d
commit 8e5521d76b
2 changed files with 3 additions and 18 deletions

View File

@ -716,12 +716,12 @@ Document* ScreenOrientation::GetResponsibleDocument() const {
}
void ScreenOrientation::MaybeChanged() {
if (ShouldResistFingerprinting()) {
Document* doc = GetResponsibleDocument();
if (!doc || doc->ShouldResistFingerprinting()) {
return;
}
Document* doc = GetResponsibleDocument();
BrowsingContext* bc = doc ? doc->GetBrowsingContext() : nullptr;
BrowsingContext* bc = doc->GetBrowsingContext();
if (!bc) {
return;
}
@ -805,19 +805,6 @@ JSObject* ScreenOrientation::WrapObject(JSContext* aCx,
return ScreenOrientation_Binding::Wrap(aCx, this, aGivenProto);
}
bool ScreenOrientation::ShouldResistFingerprinting() const {
if (nsContentUtils::ShouldResistFingerprinting(
"Legacy RFP function called to avoid observed hangs in the code "
"below if we can avoid it.")) {
bool resist = false;
if (nsCOMPtr<nsPIDOMWindowInner> owner = GetOwner()) {
resist = nsContentUtils::ShouldResistFingerprinting(owner->GetDocShell());
}
return resist;
}
return false;
}
NS_IMPL_ISUPPORTS(ScreenOrientation::VisibleEventListener, nsIDOMEventListener)
NS_IMETHODIMP

View File

@ -90,8 +90,6 @@ class ScreenOrientation final : public DOMEventTargetHelper {
nsCOMPtr<nsIRunnable> DispatchChangeEventAndResolvePromise();
bool ShouldResistFingerprinting() const;
LockPermission GetLockOrientationPermission(bool aCheckSandbox) const;
// Gets the responsible document as defined in the spec.