Closed Bug 814789 Opened 8 years ago Closed 8 years ago

Tie the life-time of the AudioContext to the life-time of the document owning it

Categories

(Core :: Web Audio, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla20

People

(Reporter: ehsan, Assigned: ehsan)

References

Details

Attachments

(1 file)

So we need to this because of two reasons.

1. The spec says so (!)
2. Otherwise, the shutdown code that I'm adding for shutting down the audio thread pool will depend on when the AudioContext object gets gc'ed, which in practice means a multi-second pause during shutdown.
Attached patch Patch (v1)Splinter Review
Assignee: nobody → ehsan
Status: NEW → ASSIGNED
Attachment #684818 - Flags: review?(bzbarsky)
Comment on attachment 684818 [details] [diff] [review]
Patch (v1)

nsPIDOMWindow inherits from nsIDOMWindow, so in the constructor you can just make "window" be of type nsCOMPtr<nsPIDOMWindow> and not have the extra QI.

r=me with that.

Do we do something with pausing audio when we go into bfcache, btw?
Attachment #684818 - Flags: review?(bzbarsky) → review+
(In reply to Boris Zbarsky (:bz) from comment #2)
> Comment on attachment 684818 [details] [diff] [review]
> Patch (v1)
> 
> nsPIDOMWindow inherits from nsIDOMWindow, so in the constructor you can just
> make "window" be of type nsCOMPtr<nsPIDOMWindow> and not have the extra QI.
> 
> r=me with that.

Will do.

> Do we do something with pausing audio when we go into bfcache, btw?

Filed bug 815492.
This is failing to compile on tbox because AudioContext.h is not actually exported to mozilla/dom ?
(In reply to Boris Zbarsky (:bz) from comment #5)
> This is failing to compile on tbox because AudioContext.h is not actually
> exported to mozilla/dom ?

Hmm, yeah, it seems like I have that file in my objdir for some reason...  Will push a fix shortly.
The reason is that I have added that in one of my other patches on this branch, of course...
https://hg.mozilla.org/mozilla-central/rev/125716cf3d81
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
Depends on: 827541
Mass moving Web Audio bugs to the Web Audio component.  Filter on duckityduck.
Component: Video/Audio → Web Audio
You need to log in before you can comment on or make changes to this bug.