Open Bug 1731565 Opened 3 years ago Updated 1 year ago

Cleanup global "browsing context event map" when a browsing context gets closed

Categories

(Remote Protocol :: WebDriver BiDi, task, P3)

task
Points:
2

Tracking

(Not tracked)

People

(Reporter: whimboo, Unassigned)

References

(Blocks 1 open bug, )

Details

(Whiteboard: [webdriver:backlog])

When browsing contexts are getting closed with events registered, we might have to clean-up some internal state and distribute that across content processes.

Depends on: 1694390
Depends on: 1694145

Note that when a BrowsingContext closes, the corresponding JS Window Actor pair is destroyed, which destroys all MessageHandler, which destroys all modules. Normally we already remove log.entryAdded listeners via https://searchfox.org/mozilla-central/rev/13378066961f195595822d4f543c8ac5b7f46490/remote/webdriver-bidi/modules/windowglobal/log.jsm#26-31

Or maybe you have something else/more specific in mind?

(otherwise there is an issue when a session end and we destroy a Root MessageHandler, but that's Bug 1730913)

Nothing specific here. It's just a place-holder for whatever could come up.

Points: --- → 2
Priority: -- → P3

This bug is actually about cleaning up the global subscription state for a closed top-level browsing context. Right now it's not clear from the spec if this should be done or not when a browsingContext.contextDestroyed event is handled. If we won't do it then outdated event subscriptions will remain in the global subscription map.

James, is that an issue with the spec and we should define it there?

Flags: needinfo?(james)
Whiteboard: [bidi-m2-mvp] → [bidi-m3-mvp]

It's a leak in the spec, but I don't think it's observable (you can't end up reusing the same state for another context), so you can either regard it as a bug in the spec, or as unnecessary to specify because it doesn't affect any requirements on implementations.

Flags: needinfo?(james)

I filed https://github.com/w3c/webdriver-bidi/issues/166 for this particular question.

As long as we do not support event subscriptions for individual browsing contexts (bug 1723102) we won't have to do anything here.

Depends on: 1723102
Summary: Cleanup internal event subscription states for closed browsing contexts → Cleanup global browsing context event map when browsing contexts get closed
No longer blocks: 1724669
Blocks: 1719287
Whiteboard: [bidi-m3-mvp] → [webdriver:backlog]
Depends on: 1790466
Summary: Cleanup global browsing context event map when browsing contexts get closed → Cleanup global "browsing context event map" when a browsing context gets closed
You need to log in before you can comment on or make changes to this bug.