Pause Web Audio streams when we go into the bfcache

RESOLVED FIXED in mozilla22

Status

()

defect
RESOLVED FIXED
7 years ago
4 years ago

People

(Reporter: Ehsan, Assigned: Ehsan)

Tracking

Trunk
mozilla22
x86
macOS
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Boris, can you please explain what we should do here?  Thanks!
So the basic idea is that when a page is unloaded we should stop playing sound from it, whether it's going into bfache or whether the window is being torn down.

Bug 814789 does the latter, because nsGlobalWindow::SetNewDocument does this:

      if (!currentInner->IsFrozen()) {
        currentInner->FreeInnerObjects();
      }

before switching to the new inner.

To handle the bfache case, I think what we want to do is something along the lines of nsGlobalWindow::SuspendTimeouts and nsGlobalWindow::ResumeTimeouts (as called from WindowStateHolder::WindowStateHolder and nsDocShell::RestoreFromHistory, though for the latter we may be able to do it from nsGlobalWindow::RestoreWindowState instead).  And we'll need to basically pause/resume the audio there, all the way down the window tree.
Duplicate of this bug: 851412
Assignee: nobody → ehsan
Posted patch Patch (v1)Splinter Review
Attachment #728022 - Flags: review?(bzbarsky)
Blocks: 853718
Comment on attachment 728022 [details] [diff] [review]
Patch (v1)

r=me
Attachment #728022 - Flags: review?(bzbarsky) → review+
https://hg.mozilla.org/mozilla-central/rev/fe50f4cbc119
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
Mass moving Web Audio bugs to the Web Audio component.  Filter on duckityduck.
Component: Video/Audio → Web Audio
Duplicate of this bug: 966873
You need to log in before you can comment on or make changes to this bug.