Closed Bug 1596169 Opened 5 years ago Closed 5 years ago

Run stopTrackingMouseOverVideos inside of PictureInPictureChild's willDestroy

Categories

(Toolkit :: Video/Audio Controls, task, P1)

task

Tracking

()

RESOLVED FIXED
mozilla74
Tracking Status
firefox74 --- fixed

People

(Reporter: mconley, Assigned: mconley)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Inside of PictureInPictureChild's willDestroy, we call removeMouseButtonListeners();, which gets rid of all of the event listeners that we use to detect clicks on the page to check for clicking on the PiP toggle.

There are, however, other event listeners that aren't being removed, and more importantly, there are DeferredTask's that aren't being disarmed and torn down. This is causing us to sometimes log error messages to the console when navigating away, because the JSWindowActorChild has gone away by the time the DeferredTask runs.

So in willDestroy, we should call stopTrackingMouseOverVideos instead, which also shuts down the DeferredTask's (and also calls removeMouseButtonListeners).

Depends on: 1596187

Inside of PictureInPictureChild's willDestroy, we were calling removeMouseButtonListeners();,
which gets rid of all of the event listeners that we use to detect clicks on the page to
check for clicking on the PiP toggle.

There are, however, other event listeners that weren't being removed, and more importantly,
there were DeferredTask's that weren't being disarmed and torn down. This was causing us to
sometimes log error messages to the console when navigating between pages, because the
JSWindowActorChild has gone away by the time the DeferredTask runs.

So now we call stopTrackingMouseOverVideos instead, which also shuts down the DeferredTask's
(and also calls removeMouseButtonListeners).

Priority: -- → P1

There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:mconley, could you have a look please?
For more information, please visit auto_nag documentation.

Flags: needinfo?(mconley)

I think this can land now.

Flags: needinfo?(mconley)
Pushed by mconley@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/01291e2d9715 Do a better job of cleaning up inside of PictureInPictureChild::willDestroy. r=mstriemer
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla74
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: