Closed Bug 1646532 Opened 6 years ago Closed 5 years ago

Fix GetInProcessTopInternal usage in nsGlobalWindowOuter::ShouldPromptToBlockDialogs/AreDialogsEnabled/EnableDialogs/DisableDialogs

Categories

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

defect

Tracking

()

RESOLVED FIXED
92 Branch
Fission Milestone M8
Tracking Status
firefox92 --- fixed

People

(Reporter: kmag, Assigned: annyG)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

No description provided.

Also goes for nsGlobalWindowOuter::TemporarilyDisableDialogs

And nsGlobalWindowInner::DialogsAreBeingAbused

Severity: -- → N/A
Type: defect → task

Seems to be related to alert()-spam. With current implementation, would not impact oop subframes.

Fission Milestone: --- → M7
Assignee: nobody → smacleod
Status: NEW → ASSIGNED
Priority: -- → P2

I think we should be able to do this by moving topWindow->mAreDialogsEnabled onto the toplevel WindowContext as a synced field, as we only ever clear it to false outside of nsIDOMWindowUtils::EnableDialogs, which can probably be deleted as I don't see any callers in-tree (https://bugzilla.mozilla.org/show_bug.cgi?id=1669392)

The mDialogAbuseCount flag might be nice to support across processes, but that may be trickier. We would probably need to start tracking the information in the parent process on WindowGlobalParent, and move when we're rejecting things to a different process in the dialog flow.

Doesn't have to block M7, let's fix in M7a.

Type: task → defect
Fission Milestone: M7 → M7a
Assignee: steven → nobody
Status: ASSIGNED → NEW

Johann, do you have thoughts for mDialogAbuseCount (see comment 4)?

Fission Milestone: M7a → M8
Flags: needinfo?(jhofmann)

Ethan recommended to ask pbz to look into this.

Flags: needinfo?(pbz)

(In reply to Neha Kochar [:neha] from comment #6)

Johann, do you have thoughts for mDialogAbuseCount (see comment 4)?

Neha, we don't quite understand what you were asking. Could you elaborate your question?

In the meantime, I am redirecting the needinfo to Jens because this code doesn't fit our team's domain expertise.

Flags: needinfo?(pbz)
Flags: needinfo?(jstutte)
Flags: needinfo?(jhofmann)

I looked into this a bit more with :neha earlier today, and came to the conclusion that these members generally shouldn't be synced between processes, and should continue to be process-local. There is one use-case which might be useful to be process synced, which is setting mAreDialogsEnabled to false in the background thumbnailer code (https://searchfox.org/mozilla-central/rev/f351e19360729b351bfc7c1386d6e4ca4ea676e2/toolkit/actors/BackgroundThumbnailsChild.jsm#97), however that code is no longer being actively used by the newtab page, and will probably be disabled soon (bug 1706449). It seems fairly reasonable to leave mDialogAbuseCount alone for now, as it will still serve its purpose just fine within a process.

The one change which might be worth making here as a clean-up for fission would be to move these two attributes off of nsGlobalWindowInner and instead put them on BrowsingContextGroup, so that they're shared between all in-process documents within a BrowsingContextGroup, rather than only by in-process docShell subtrees. This should involve no functional changes, mostly just moving the attributes and replacing GetInProcessTopInternal() uses with GetBrowsingContext()->Group(). No cross-process syncing should be necessary :-)

Flags: needinfo?(jstutte)

Anny, would you be able to finish up the remaining clean-up here?

Flags: needinfo?(agakhokidze)
Assignee: nobody → agakhokidze
Status: NEW → ASSIGNED
Flags: needinfo?(agakhokidze)
Attachment #9230108 - Attachment description: WIP: Bug 1646532 - Move mAreDialogsEnabled and mDialogAbuseCount to BC group, r=nika! → Bug 1646532 - Move mAreDialogsEnabled and mDialogAbuseCount to BC group, r=nika!
Attachment #9230108 - Attachment description: Bug 1646532 - Move mAreDialogsEnabled and mDialogAbuseCount to BC group, r=nika! → WIP: Bug 1646532 - Move mAreDialogsEnabled and mDialogAbuseCount to BC group, r=nika!
Attachment #9230108 - Attachment description: WIP: Bug 1646532 - Move mAreDialogsEnabled and mDialogAbuseCount to BC group, r=nika! → Bug 1646532 - Move mAreDialogsEnabled and mDialogAbuseCount to BC group, r=nika!
Attachment #9230108 - Attachment description: Bug 1646532 - Move mAreDialogsEnabled and mDialogAbuseCount to BC group, r=nika! → Bug 1646532 - Move mAreDialogsEnabled, mLastDialogQuitTime and mDialogAbuseCount to BC group, r=nika!
Pushed by agakhokidze@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/990ee1a69537 Move mAreDialogsEnabled, mLastDialogQuitTime and mDialogAbuseCount to BC group, r=nika
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → 92 Branch
Regressions: 1719874
Regressions: 1732053
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: