Bug 1596187 Comment 8 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

(In reply to Mike Conley (:mconley) (:⚙️) (Wayyyy behind on needinfos) from comment #7)
> (In reply to John Dai[:jdai] from comment #6)
> Hm. So what you're saying is that if the tab is closed, a JSWindowActorChild has no opportunity to send any messages to the parent via the `willDestroy` method?

Right, `willDestroy` rely on BrowserChild still exist or IsDestroyed flag[1] not set. However, BrowserChild destroies[2] before `willDestroy` is called. I don't have a better solution right now. 

[1] https://searchfox.org/mozilla-central/rev/3483fb259b4edbe4594cfcc3911db97d5441b67d/dom/ipc/WindowGlobalChild.cpp#223
[2] https://searchfox.org/mozilla-central/rev/581466eef9269afb03d8a0dba2f50215f3a9026c/dom/ipc/BrowserChild.cpp#2446
(In reply to Mike Conley (:mconley) (:⚙️) (Wayyyy behind on needinfos) from comment #7)
> (In reply to John Dai[:jdai] from comment #6)
> Hm. So what you're saying is that if the tab is closed, a JSWindowActorChild has no opportunity to send any messages to the parent via the `willDestroy` method?

Right, `willDestroy` rely on BrowserChild still exist or IsDestroyed flag[1] not set. However, BrowserChild is destroyed[2] before `willDestroy` is called. I don't have a better solution right now. 

[1] https://searchfox.org/mozilla-central/rev/3483fb259b4edbe4594cfcc3911db97d5441b67d/dom/ipc/WindowGlobalChild.cpp#223
[2] https://searchfox.org/mozilla-central/rev/581466eef9269afb03d8a0dba2f50215f3a9026c/dom/ipc/BrowserChild.cpp#2446

Back to Bug 1596187 Comment 8