Closed Bug 1721840 Opened 6 months ago Closed 4 months ago

ScreenOrientation::ShouldResistFingerprinting is hangey?

Categories

(Core :: DOM: Core & HTML, defect, P3)

defect

Tracking

()

RESOLVED FIXED
95 Branch
Tracking Status
firefox95 --- fixed

People

(Reporter: tjr, Assigned: asharm28)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [bhr:ScreenOrientation::ShouldResistFingerprinting])

Attachments

(6 files)

According to hang-stats mozilla::dom::ScreenOrientation::ShouldResistFingerprinting() is consistently found in hangs every day.

The content of this function is

bool ScreenOrientation::ShouldResistFingerprinting() const {
  bool resist = false;
  if (nsCOMPtr<nsPIDOMWindowInner> owner = GetOwner()) {
    resist = nsContentUtils::ShouldResistFingerprinting(owner->GetDocShell());
  }
  return resist;
}

Which seems pretty tight. The call to ShouldResistFingerprinting() inside the function cascades down to several other ShouldResistFingerprinting() functions, some which are inlined I'm sure, but the more complicated one seems unlikely to be inlined...

This is a bit surprising. Shouldn't resist fingerprinting pref be usually off?

Severity: -- → S3
Priority: -- → P3

Doesn't matter if it's off or not; we still check if it is enabled on a ton of code paths.

Presently our plan has been to change all of the ShouldRFP checks into detailed checks that look at the current context (principal/addon/origin). This would let us control RFP on a very granular level, which is something people have sought for a long time. Maybe we need to wrap those detailed checks with a simple "Is RFP enabled at all" check which might avoid this hangey problem which is presumably coming from the GetOwner()/GetDocShell() calls. (Because we don't see other ShouldRFP checks showing up in hang stats, just this one.)

Assignee: nobody → asharm28
Status: NEW → ASSIGNED

Depends on D126165

Attachment #9242176 - Attachment description: Commit for Bug 1721840: Patch Test r=tjr → Bug 1721840: Wrap RFP Check with a more coarse one to avoid hangs r?tjr
Pushed by tritter@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f70260102c95
Wrap RFP Check with a more coarse one to avoid hangs r=tjr
Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → 95 Branch
Attachment #9245416 - Attachment description: Bug 1721840 - Surrounded book ShouldResistFingerprinting function with if statement and return function (formatting fixed). r?tjr → Bug 1721840 - Surrounded bool ShouldResistFingerprinting function with if statement and return function (formatting fixed). r?tjr
Attached file WIP: Bug 1721840

Cody Craig
Surrounded lines 573-577 with if(nsContentUtils::ShouldResistFingerprinting()){/stuff already in lines goes here/}
return false;

Should offer a good testing tool for further work

Attachment #9245416 - Attachment description: Bug 1721840 - Surrounded bool ShouldResistFingerprinting function with if statement and return function (formatting fixed). r?tjr → Bug 1721840 - Surrounded book ShouldResistFingerprinting function with if statement and return function (formatting fixed). r?tjr
You need to log in before you can comment on or make changes to this bug.