Closed Bug 1543251 Opened 5 years ago Closed 5 years ago

Move hasBeforeUnload from nsITabParent to CanonicalBrowsingContext

Categories

(Core :: DOM: Content Processes, task, P2)

task

Tracking

()

RESOLVED FIXED
mozilla70
Fission Milestone M4
Tracking Status
firefox70 --- fixed

People

(Reporter: mconley, Assigned: u608768)

References

Details

Attachments

(1 file)

We added hasBeforeUnload to nsITabParent in bug 1336763 so that we could know whether or not we needed to run permitUnload for the frames in a tab that was closing, or if we could just close it right away.

In a Fission-world, it makes sense, I think, to either put this hasBeforeUnload property on the top-most CanonicalBrowsingContext of a tree in the chrome process, or the associated WindowGlobalParent. Either is fine with me.

Here's where we increment and decrement (two places) the beforeunload event listener counts in the content process.

Fission Milestone: --- → ?

The priority flag is not set for this bug.
:jimm, could you have a look please?

Flags: needinfo?(jmathies)
Flags: needinfo?(jmathies)
Priority: -- → P3

ni for Andreas for thoughts on this. Candidate for M4?

Flags: needinfo?(afarre)

Sounds perfectly doable. M4, sure.

Flags: needinfo?(afarre)
Fission Milestone: ? → M4

It might make more sense to keep track of this on WindowGlobalParent, given that these are recorded per-inner-window already. That way we'd get clearing the count upon changing the active global from navigations for free.

We'd probably put a flag on WindowGlobalParent, and perhaps move the count from nsGlobalWindowInner to WindowGlobalChild. Whenever the number on the WindowGlobalChild changes from or to 0, we'd send a message over the WindowGlobal actor (e.g. SendAddedBeforeUnloadListener or SendRemovedBeforeUnloadListener) which would flip the bit in the parent process.

Assignee: nobody → kmadan
Type: defect → task
Status: NEW → ASSIGNED
Priority: P3 → P2
Attachment #9076089 - Attachment description: Bug 1543251 - Move hasBeforeUnload from nsIRemoteTab to WindowGlobal, r=nika → Bug 1543251 - Move hasBeforeUnload from PBrowser to PWindowGlobal, r=nika
Pushed by kmadan@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/405100db6c45
Move hasBeforeUnload from PBrowser to PWindowGlobal, r=nika
Flags: needinfo?(kmadan)
Pushed by kmadan@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/6709a3bc1a1c
Move hasBeforeUnload from PBrowser to PWindowGlobal, r=nika
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
Regressions: 1566310
Regressions: 1566343
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: