The patch removes 455 occurrences of FAIL_ON_WARNINGS from moz.build files, and
adds 78 instances of ALLOW_COMPILER_WARNINGS. About half of those 78 are in
code we control and which should be removable with a little effort.
--HG--
extra : rebase_source : 82e3387abfbd5f1471e953961d301d3d97ed2973
The avoids the allocation and copying altogether when the output buffer
is silent.
--HG--
extra : rebase_source : f225628dc9bb2ea0cd0ec414a2212e39da92405f
This API lets AudioBuffer generators avoid a copy.
Future modifications to AudioBuffer will remove the unnecessary initial
allocation and zeroing.
--HG--
extra : rebase_source : 50f4d4dd79b32111583748d0b83065a13b03d888
Being able to write to the channel data in the buffer list saves the creator
from needing to manage its own pointers to the channel data.
--HG--
extra : rebase_source : 02b22b8b2dc2d640bec706433d7f921858fd8ef4
MediaStreamAudioDestinationNode does not need any main thread events because
mDOMStream provides GetCurrentTime to consumers.
MediaRecoder also does not use main thread current time.
--HG--
extra : rebase_source : e022dc12e8a0e67c70d4a617449e28e76288b57e
AudioBuffers are often generated from OfflineAudioContext to be used in other
contexts, when the OfflineAudioContext is no longer required.
--HG--
extra : rebase_source : 4d163ba69164f813256478ed0870803421c1f6a5
This is motivated by three separate but related problems:
1. Our concept of recursion depth is broken for things that run from AfterProcessNextEvent observers (e.g. Promises). We decrement the recursionDepth counter before firing observers, so a Promise callback running at the lowest event loop depth has a recursion depth of 0 (whereas a regular nsIRunnable would be 1). This is a problem because it's impossible to distinguish a Promise running after a sync XHR's onreadystatechange handler from a top-level event (since the former runs with depth 2 - 1 = 1, and the latter runs with just 1).
2. The nsIThreadObserver mechanism that is used by a lot of code to run "after" the current event is a poor fit for anything that runs script. First, the order the observers fire in is the order they were added, not anything fixed by spec. Additionally, running script can cause the event loop to spin, which is a big source of pain here (bholley has some nasty bug caused by this).
3. We run Promises from different points in the code for workers and main thread. The latter runs from XPConnect's nsIThreadObserver callbacks, while the former runs from a hardcoded call to run Promises in the worker event loop. What workers do is particularly problematic because it means we can't get the right recursion depth no matter what we do to nsThread.
The solve this, this patch does the following:
1. Consolidate some handling of microtasks and all handling of stable state from appshell and WorkerPrivate into CycleCollectedJSRuntime.
2. Make the recursionDepth counter only available to CycleCollectedJSRuntime (and its consumers) and remove it from the nsIThreadInternal and nsIThreadObserver APIs.
3. Adjust the recursionDepth counter so that microtasks run with the recursionDepth of the task they are associated with.
4. Introduce the concept of metastable state to replace appshell's RunBeforeNextEvent. Metastable state is reached after every microtask or task is completed. This provides the semantics that bent and I want for IndexedDB, where transactions autocommit at the end of a microtask and do not "spill" from one microtask into a subsequent microtask. This differs from appshell's RunBeforeNextEvent in two ways:
a) It fires between microtasks, which was the motivation for starting this.
b) It no longer ensures that we're at the same event loop depth in the native event queue. bent decided we don't care about this.
5. Reorder stable state to happen after microtasks such as Promises, per HTML. Right now we call the regular thread observers, including appshell, before the main thread observer (XPConnect), so stable state tasks happen before microtasks.
Zero output channels are used on ScriptProcessorNodes to improve efficiency in
tests when output is not required.
--HG--
extra : rebase_source : f3ddee8031d772bdcedbd482d80d3259a095e0ea
The effects of garbage collection must not be observable. We can collect an
AudioNode if it is not going to cause any further changes, but we must keep
any current effects.
--HG--
extra : rebase_source : f7ce500de2afd4f6cdff79c30c99a0ee8e74ab40
because stream inputs may be removed when only providing null data.
The ScriptProcessor is also kept alive when it has only input nodes so that it
is not garbage collected when its input nodes are collected.
--HG--
extra : rebase_source : ee70db1b3e13b212107e048620880b929c662ad6
Creating the event added a reference to the ScriptProcessorNode, which wasn't
released until the AudioProcessingEvent was destroyed in
nsCycleCollector::FreeSnowWhite().
If another event is dispatched before cycle collection considers the
ScriptProcessorNode, then the node will not be collected.
Also, the reference count of the ScriptProcessorNode is no longer toggled
because this seemed to interfere with the cycle collection process.
--HG--
extra : rebase_source : 41878e716fe3fcc8f46f518be2a50d050b8ed14c
After this change, we have ShallowSizeOf{In,Ex}cludingThis(), which don't do
anything to measure children. (They can be combined with iteration to measure
children.)
And we still have the existing single-arg SizeOf{In,Ex}cluding() functions,
which work if the entry type itself defines SizeOfExcludingThis().
--HG--
extra : rebase_source : f93de9b789c21b1b148bed9de795f663f77c9dd9
It is now no longer necessary to clear zero bins because these are zeroed
in the FFTBlock constructor.
nsTArray bounds assertions now apply.
--HG--
extra : rebase_source : 18c07ecb51f9cb3c199536fe59110093db2295d4
realP[halfSize] was always set to zero because numberOfPartials < halfSize + 1
was always true.
--HG--
extra : rebase_source : 819b04a56032d810231a16fa0dd139cf82ef8ddf