This is the full implementation of the AudioBuffer object. There are
two ways to create these objects from an audio context and this patch
implements only one of them.
The construction of the AudioBuffer object is a two step process: the
object should be created with operator new first, and then
InitializeBuffers should be called on it. InitializeBuffers is
fallible, because it uses the JS API to create the underlying typed
arrays, but that's fine, since the length of the buffers comes from web
content, and we don't want to use infallible allocations for those
anyways.
We hold on to the JS objects from the C++ implementation, and trace
through all of those objects, so that a GC does not kill those object
without us knowing.
The buffer should be possible to manipulate from both C++ and JS, and
the C++ object probably needs to support a set of methods for the C++
callers at some point.
This is the bare minimum that one needs in order to get those interfaces
implemented. The work to make the simplest of Web Audio test cases
actually pass will be done in bug 792649.
This is the bare minimum that one needs in order to get those interfaces
implemented. The work to make the simplest of Web Audio test cases
actually pass will be done in bug 792649.
The valid annotations are [Throws], [GetterThrows], and [SetterThrows], which can all either take no value or
be set to MainThread or Workers if the throwing behavior is only happening on main thread or in workers
There are several parts here:
1) Enforce the requirement that dictionary arguments not followed by a required argument are optional.
2) Make dictionaries no longer be distinguishable from nullable types.
3) Disallow dictionaries or unions containing dictionaries inside a nullable type.
4) Force optional dictionaries to have a default value of null so that codegen doesn't have to worry about dealing with
optional arguments that have no default value in the IDL but need to be treated as if they were null.
There are several parts here:
1) Enforce the requirement that dictionary arguments not followed by a required argument are optional.
2) Make dictionaries no longer be distinguishable from nullable types.
3) Disallow dictionaries or unions containing dictionaries inside a nullable type.
4) Force optional dictionaries to have a default value of null so that codegen doesn't have to worry about dealing with
optional arguments that have no default value in the IDL but need to be treated as if they were null.
In this new setup, there are three new extended attributes: Infallible,
GetterInfallible, SetterInfallible. The first one applies to both methods and
attributes, while the last two apply only to attributes. Each one can be
either set with no value specified (in which case it applies both on main
thread and in workers) or can be set to MainThread or Workers to limit where it
applies.
If Infallible is set on an attribute, then GetterInfallible and
SetterInfallible will be ignored. So if you want to specify, for example, an
attribute that's infallible on the main thread and has an infallible getter in
workers, the right way to do that is [GetterInfallible,
SetterInfallible=MainThread].