In future parts, TaskQueue will require extra initialization to be performed
which cannot happen in a constructor, as it takes references to the TaskQueue
object itself, which will require the introduction of a helper method. This
patch switches all callers of the TaskQueue constructor to use the new method.
Differential Revision: https://phabricator.services.mozilla.com/D142604
There weren't that many uses of the existing typedef, so it seemed like
it might be worthwhile to just replace all uses of the previous typedef
with the stl-like one.
Differential Revision: https://phabricator.services.mozilla.com/D142705
What is happening here is that the left hand side operand of the equality
operator is an integer, and the right hand side operand is a float, that has a
fractional value that is not null. The left hand side gets promoted to a float
and the equality check fails.
In practice, the graph is always instantiated with a sample-rate that is an
integer, and this conversion happens without explicit rounding, so it's a floor
operation. However, the sample-rate of an AudioContext is a float, so there is
an edge case where the graph and the AudioContext don't have the same
sample-rate.
I don't think this matters in practice.
Switching to comparing that the graph passed as a parameter is the same as the
graph the AudioNode is in is enough to assert here and doesn't suffer from the
sample-rate problem.
Differential Revision: https://phabricator.services.mozilla.com/D135044
-Wshadow warnings are not enabled globally, so these -Wno-shadow suppressions have no effect. I had intended to enable -Wshadow globally along with these suppressions in some directories (in bug 1272513), but that was blocked by other issues.
There are too many -Wshadow warnings (now over 2000) to realistically fix them all. We should remove all these unnecessary -Wno-shadow flags cluttering many moz.build files.
Differential Revision: https://phabricator.services.mozilla.com/D132289
Building with `ac_add_options --disable-unified-build` on macOS hits the following warnings-as-errors:
dom/media/GraphDriver.cpp:594:21: warning: code will never be executed [-Wunreachable-code]
dom/media/webaudio/blink/HRTFPanner.cpp:43:16 [-Wunused-const-variable] unused variable 'RenderingQuantum'
Differential Revision: https://phabricator.services.mozilla.com/D126754
Let running AudioContext also prevents tab from being suspended by asking/revoking the page awake via the browsing context.
Differential Revision: https://phabricator.services.mozilla.com/D119839
It's better to change the input parameter's type of
`AppendAndConsumeChunk` from `AudioChunk*` to `AudioChunk&&` since the
`AudioChunk` will be consumed once it's fed to this function.
One benefit for doing so is to prevent the consumed `AudioChunk` from
being used again after it's moved/consumed. Gecko has a clang-tidy
check, bugprone-use-after-move [1], to avoid this kind of error. We
should utilize this check instead of catching used-after-move error by
human eyes.
[1]: https://searchfox.org/mozilla-central/rev/f351e19360729b351bfc7c1386d6e4ca4ea676e2/tools/clang-tidy/config.yaml#70
Differential Revision: https://phabricator.services.mozilla.com/D117714
It's better to change the input parameter's type of
`AppendAndConsumeChunk` from `AudioChunk*` to `AudioChunk&&` since the
`AudioChunk` will be consumed once it's fed to this function.
One benefit for doing so is to prevent the consumed `AudioChunk` from
being used again after it's moved/consumed. Gecko has a clang-tidy
check, bugprone-use-after-move [1], to avoid this kind of error. We
should utilize this check instead of catching used-after-move error by
human eyes.
Differential Revision: https://phabricator.services.mozilla.com/D117714