This removes about 2/3 of the occurrences of nsXPIDLString in the tree. The
places where nsXPIDLStrings are null-checked are replaced with |rv| checks.
The patch also removes a couple of unused declarations from
nsIStringBundle.idl.
Note that nsStringBundle::GetStringFromNameHelper() was merged into
GetStringFromName(), because they both would have had the same signature.
--HG--
extra : rebase_source : ac40bc31c2a4997f2db0bd5069cc008757a2df6d
This mechanically replaces nsILocalFile with nsIFile in
*.js, *.jsm, *.sjs, *.html, *.xul, *.xml, and *.py.
MozReview-Commit-ID: 4ecl3RZhOwC
--HG--
extra : rebase_source : 412880ea27766118c38498d021331a3df6bccc70
Since now MFR doesn't need an AbstractMediaDecoder at all, we can
now remove BufferDecoder which exists as an empty shell to implement AbstractMediaDecoder.
MozReview-Commit-ID: HpEcK0mfpeh
--HG--
extra : rebase_source : e4d58d3b706aaf6ee005b9f82a668dd38efc2200
extra : intermediate-source : caa1e64b1a0216773d31854341075858a8dc2d0f
extra : source : c644912a8eeed0a18d61e11a3bcc92a39a6de483
We will remove MediaDecoderReader in the future.
MozReview-Commit-ID: BaCRXleKK5a
--HG--
extra : rebase_source : dc14a593d6291136f02b1deb910cd6dcd01c0355
extra : source : 8f71b7dae0a541562c7c3829b5a873e9f9fd2674
It would be handy we want to pass more data to the constructor.
MozReview-Commit-ID: 3AUUsTbv534
--HG--
extra : rebase_source : 8d230c85addf1ba296e6a0512f0d18ebd41c0d17
extra : source : e6568e9fa24f52c59baecaa16aa044b492f407fb
Note we remove the call to mChannel->SetContentType() from RecreateChannel().
The hint never works as expected for [1] is the only caller to
nsIChannel::GetContentType() and MediaResource::Create() always happens
before any reads from the resource.
[1] http://searchfox.org/mozilla-central/rev/b425854d9bbd49d5caf9baef3686e49ec91c17ec/dom/media/MediaResource.cpp#1500
MozReview-Commit-ID: 1n4yHEouCjC
--HG--
extra : rebase_source : 9a7345c29b985ddee7a90a94191e9d526e2a0a67
extra : source : 054d9ffaf21eb937a6349df76228269ad2d7dc2c
This patch gives some structure and order to the profiler's API.
It also renames AutoProfilerRegister as AutoProfilerRegisterThread, to match
profiler_register_thread().
This patch is adapted from Tor bug 1517.
To offer some protection against timing attacks by JS content pages, in this
patch we round the various time-exposing APIs (such as Date and
Event.timeStamps) to the nearest 100 ms when the pref "privacy.resistFingerprinting" is on.
MozReview-Commit-ID: eGucM9nGTn
--HG--
extra : rebase_source : 3ee600b07943f3954e9a2a9561391f2f7821bb86
We no longer support decoding non-EME audio via GMPs, so it's not possible
for a GMP to be used for decoding content that passes through a WebAudio
BufferDecoder. So we don't need to keep the GMPCrashHelper around in the
WebAudio code. If EME content is being used, there will be a crash helper on
the MediaKeys object anyway.
MozReview-Commit-ID: BThxnTANSTD
--HG--
extra : rebase_source : 2c2ce4e982dcef6e3985c426386974083505c953
Since MozPromise supports move-only types, we don't need to make MetadataHolder a ref-counted type.
MozReview-Commit-ID: E7KJuFQNWxe
--HG--
extra : rebase_source : d303c4d119504a289fe60cf5cdd2793ebf58d643
Since RefPtr<T>&& can't be converted to T* implicitly, we need to change
T* to RefPtr<T> in resolve/reject callbacks to make it compile again.
We should review the changes later to look for the opportunity to
optimize away unnecessary AddRef/Release pairs.
MozReview-Commit-ID: 22rHQ8dhxJv
--HG--
extra : rebase_source : 1b09f353d6e86d60c93a2746333585ec0dba8526
This was used only for B2G, was proprietary, and is causing issues, because
`AudioContext` can now have a parameter that is a property bag, per spec
(although we haven't implemented it at the moment).
MozReview-Commit-ID: 6LOlNp0cbfV
--HG--
extra : rebase_source : 48aa342213dba201c1062a08c7453acd16b8baea
NS_SetCurrentThreadName() is added as an alternative to PR_SetCurrentThreadName()
inside libxul. The thread names are collected in the form of crash annotation to
be processed on socorro.
MozReview-Commit-ID: 4RpAWzTuvPs
This happens when the listener and a PannerNode are at the same position, and
a cone gain has been specified.
The issue is that our implementation of 3d vector normalization does not
special-case vectors that have all components at zero, that dividing by zero
results in infinity, and multiplying by infinity produces NaN.
This end up setting the volume member for the output AudioChunk to NaN, and this
breaks everything downstream, of course. In practice, silence is output, with
some clicks (on linux/pulse at least).
MozReview-Commit-ID: 8u54LixvYMu
--HG--
extra : rebase_source : 3b37970b42e5c60cd6e39d3197b580edc63b5ac9
float(numeric_limits<int>::max()) can round up and so this inequality was
false even when f was (float)0x80000000 (without rounding) and could not be
represented by an int.
--HG--
extra : rebase_source : 758b66fcab9ec540cf444e573f7f3a7bf9c06ba2
Web audio should also notify AudioChannelService about its audible state change.
MozReview-Commit-ID: BtjUkHKPETg
--HG--
extra : rebase_source : 809549258b652cb1e531dedfd6aee869d32aa4e4
Spec (being written): https://github.com/WebAudio/web-audio-api/issues/1139
Bug 1343550 - Prevent touching promises when shutting down an AudioContext, when the global is going away soon. r=baku
MozReview-Commit-ID: F6en9KEbNNf
--HG--
extra : rebase_source : 04076caa38bba980cdff776b5997f33e24516d9e
extra : intermediate-source : 4f2cd3f715a218dc3bca55e89720b6aa1040d35c
extra : source : 69cd9c72bd4ed419e3f7f7b5ab64ee0fa8bd89a2
This also removes the extra logging I added in loadFile which did not end up
helping anything after all.
MozReview-Commit-ID: FZT5ZShhcG0
--HG--
extra : rebase_source : f5eca9ae169c99dabfbb02dd148b66524325d352
It seems like adding these extra "todos" decreases the frequency of this
intermittent. I think it makes sense to land these temporarily while we look
for a root cause.
MozReview-Commit-ID: 4RiXtT3yBzG
--HG--
extra : rebase_source : fc107091d0a34943df3bf3ca579d978b97de877f
Changed |print("enum ID : uint32_t {", file=output)| to |print("enum HistogramID : uint32_t {", file=output)| at line 53 of the file |toolkit/components/telemetry/gen-histogram-enum.py|, and then replaced all the textual occurrences of |Telemetry::ID| to |Telemetry::HistogramID| and |ID| to |HistogramID| in 43 other files.
In websites such as Facebook Live, timeout chains are used to drive the
playback of a video or something similar in JavaScript. Throttling the
minimum timeout values a tab playing a video from such websites in the
background could make the timeout based scheduling of video playback to
not work correctly, and cause audio buffer under-runs that are audible.
In order to address this, other major browsers don't throttle timeouts
in tabs that are playing audio. This brings us to parity to other
browsers (even though we already do this for websites that use Web Audio
since we've had similar bug reports using the Web Audio API.)
The current audio agent setup that drives the tab audio notification
icons is currently tracking whether a Window is playing audio. We use
this setup to decide whether to throttle timeouts when a window goes
into background.
Continuing the work of replacing MIME strings with MediaContainerType, starting
from MediaResource and following the dependencies.
Most changes are mechanical: Just change ns*String into MediaContainerType, and
MIME string literals into MEDIAMIMETYPE("a/b").
Some checks for empty/invalid strings and lowercase comparisons can go, thanks
to the always-valid always-lowercase-MIME invariants of MediaContainerType.
One special case in is MediaSourceResource, which used to have an empty string
as its type (because its own type is not relevant, but its SourceBuffers carry
types). Because the inherited GetContentType *must* be overridden, and must
return a MediaContainerType, we needed a valid type even though it should not
be seen in the real world. I've chosen "application/x.mediasource" for that.
MozReview-Commit-ID: 1aCH75Kh2e6
--HG--
extra : rebase_source : 0d9cd9b69c264e5dcfc3845f80ee107f4bcbcd9a
As far as I can tell, this covers all the remaining threads which we start
using PR_CreateThread, except the ones that are created inside NSPR or NSS,
and except for the Shutdown Watchdog thread in nsTerminator.cpp and the
CacheIO thread. The Shutdown Watchdog thread stays alive past leak detection
during shutdown (by design), so we'd report leaks if we profiled it. The
CacheIO thread seems to stay alive past shutdown leak detection sometimes as
well.
This adds a AutoProfilerRegister stack class for easy registering and
unregistering. There are a few places where we still call
profiler_register_thread() and profiler_unregister_thread() manually, either
because registration happens conditionally, or because there is a variable that
gets put on the stack before the AutoProfilerRegister (e.g. a dynamically
generated thread name). AutoProfilerRegister needs to be the first object on
the stack because it uses its own `this` pointer as the stack top address.
MozReview-Commit-ID: 3vwhS55Yzt
--HG--
extra : rebase_source : 56dd27282e7bd09a7e7dc7ca09ccfe3a0198e7af
This adds a DenormalDisabler instance at the beginning of each
MediaStreamGraph iteration. On supported platforms, this will cause subnormal
numbers to be flushed automatically.
MozReview-Commit-ID: JGtunsqSirR
--HG--
extra : rebase_source : b051708f5191a267fc2eaef0ae40f438e1a77e4a
Since this was originally landed, chromium has added support disabling denormalized
numbers on ARM and ARM64.
MozReview-Commit-ID: 7hdZNpJqA9q
--HG--
extra : rebase_source : d628c41489b1acee9ac9aeef85ffd9ba293163a5
This interpolates over aCurveLength - 1 steps rather than over
aCurveLength steps as was done before.
Previously we would reach the final value on the curve before
the end of the specified duration. For example, on the curve
[1.0, 0.0] with duration 1000, we would interpolate from 1.0 to
0.0 by time 500 rather than time 1000. With these changes, we
don't reach 0.0 until time 1000, as expected.
This also updates TestSpecExample in TestAudioEventTimeline.cpp
to match the curve in the latest spec.
MozReview-Commit-ID: Cgs8csbRUMh
--HG--
extra : rebase_source : 1960128558ae9174933cd5be3c1fbfcb79f5ba1d
So stop()ing the output track can clean up the destination node.
MozReview-Commit-ID: CmMXRCpOeFY
--HG--
extra : rebase_source : f1625cf63989b6ab7283a021cd08bdbabf8d82ed
This required moving template function ValidateEvent into the .h file to avoid
linking problems in xul-gtest.
--HG--
rename : dom/media/webaudio/compiledtest/TestAudioEventTimeline.cpp => dom/media/webaudio/gtest/TestAudioEventTimeline.cpp
rename : dom/media/webaudio/compiledtest/moz.build => dom/media/webaudio/gtest/moz.build
extra : rebase_source : 1a8917fc0e75e9c264bc88aec5565d9fff085c12
The missing includes were hidden due to the unified build.
MozReview-Commit-ID: 5M3YnyIOW8C
--HG--
extra : rebase_source : 16a1742148c9ac24a3c011b0df3f359d82686df1
Distances less than refDistance should be treated as refDistance when calculating
the gain.
MozReview-Commit-ID: JASGb7jLp5L
--HG--
extra : rebase_source : 24e0207b7e6482000ec134bbde59ce448eee25f7
We do this by abstracting away getting the input for AudioNodes and AudioParams
with templates. This prevents removing the wrong connection when disconnecting
nodes with multiple inputs.
MozReview-Commit-ID: 3fzUKthRM1f
`aInput` clashes with outer scope variables, and we can't rename captured
variables just yet, as it is a C++14 feature that we can't use in
mozilla-central.
MozReview-Commit-ID: JL4ChEpusM4
Use CONFIG['NEON_FLAGS'] on moz.build instead.
MozReview-Commit-ID: F6R532Hi5mg
--HG--
extra : rebase_source : 7243f316de3138c702f09b336f6d430e6c9c15b5
The new name makes the sense of the condition much clearer. E.g. compare:
NS_WARN_IF_FALSE(!rv.Failed());
with:
NS_WARNING_ASSERTION(!rv.Failed());
The new name also makes it clearer that it only has effect in debug builds,
because that's standard for assertions.
--HG--
extra : rebase_source : 886e57a9e433e0cb6ed635cc075b34b7ebf81853
This adds support for HTMLMediaElement.mozCaptureStream() and
mozCaptureStreamUntilEnded() for a HTMLMediaElement playing a MediaStream.
This is up to spec, while capturing a HTMLMediaElement playing a file is not.
This incompatibility means we cannot mix sources for the returned MediaStream.
As such, a MediaStream returned while the HTMLMediaElement was playing a file
will only have content while the element is playing files. If the src changes
to a MediaStream, the stream will be empty.
It works the same way if a MediaStream was captured while the HTMLMediaElement
was playing another MediaStream.
This is due to TrackID management - MediaDecoder doesn't care, and creates new
tracks when you seek, so users are unable to keep track, while for MediaStream
we control everything from main thread and keep track of the TrackIDs used
previously.
This also adds a separate path from MediaElementAudioSourceNode so that we don't
forward video tracks when the returned MediaStream is only used internally for
WebAudio. We should in that case not require a DOMMediaStream but just forwarding
tracks to a TrackUnionStream should be enough, and will save us some cpu cycles.
This is however fine for now as it's simpler.
MozReview-Commit-ID: Bg8hESDISDU
--HG--
extra : rebase_source : 83885a73ec8cfc5fbe3c30a9330a52cd6b6dff12
extra : source : f1aec79078869c0a6435a1c06957c649d7a40dd9
Sometimes a track is added to a stream synchronously (before the stream is
exposed to script), and sometimes asynchronously (see the mediacapture-main spec
on the "addtrack" event).
In the latter case we might still need to create the MediaStreamTrack object
synchronously for tracking purposes. CaptureStream of Media element playing a
MediaStream wants this.
MozReview-Commit-ID: 7me8xzN7rwj
--HG--
extra : rebase_source : 4f129b127b855e47aad2ae9ab3981ffde057412d
This patch removes checking of all the callback calls in memory reporter
CollectReport() functions, because it's not useful.
The patch also does some associated clean-up.
- Replaces some uses of nsIMemoryReporterCallback with the preferred
nsIHandleReportCallback typedef.
- Replaces aCallback/aCb/aClosure with aHandleRepor/aData for CollectReports()
parameter names, for consistency.
- Adds MOZ_MUST_USE/[must_use] in a few places in nsIMemoryReporter.idl.
- Uses the MOZ_COLLECT_REPORT macro in all suitable places.
Overall the patch reduces code size by ~300 lines and reduces the size of
libxul by about 37 KiB on my Linux64 builds.
--HG--
extra : rebase_source : e94323614bd10463a0c5134a7276238a7ca1cf23
This updates mLastComputedValue when removing events during the call to
CleanupEventsOlderThan.
MozReview-Commit-ID: 1Veyv8kLIna
--HG--
extra : rebase_source : 9ee9aeb458b60316f93616e3310ad26f9e85e79c
This patch makes the following changes on many in-class methods.
- NS_IMETHODIMP F() override; --> NS_IMETHOD F() override;
- NS_IMETHODIMP F() override {...} --> NS_IMETHOD F() override {...}
- NS_IMETHODIMP F() final; --> NS_IMETHOD F() final;
- NS_IMETHODIMP F() final {...} --> NS_IMETHOD F() final {...}
Using NS_IMETHOD is the preferred way of marking in-class virtual methods.
Although these transformations add an explicit |virtual|, they are safe --
there's an implicit |virtual| anyway because |override| and |final| only work
with virtual methods.
--HG--
extra : rebase_source : 386ee4e4ea2ecd8d5001efabc3ac87b4d6c0659f
We need to update mLastComputedValue while processing events that occur at the
same time rather than just skipping over them.
MozReview-Commit-ID: LuxSK6PHFHv
--HG--
extra : rebase_source : be323da2a50ea32838aef322267115d153a14c3d
This patch makes most Run() declarations in subclasses of nsIRunnable have the
same form: |NS_IMETHOD Run() override|.
As a result of these changes, I had to add |override| to a couple of other
functions to satisfy clang's -Winconsistent-missing-override warning.
--HG--
extra : rebase_source : 815d0018b0b13329bb5698c410f500dddcc3ee12
Decoders now use FrameStatisticsData to gather data for their frame-related
notifications. This will ease introducing new members later on.
MozReview-Commit-ID: DWdOSPX3JM
--HG--
extra : rebase_source : a3e05f34353a397d1c82b3f4d935c0864f90556e
This will permit allowing the main thread to run while collecting
reports from graph thread objects.
MozReview-Commit-ID: 7xChGz7xJ8M
--HG--
extra : rebase_source : a69dd197bfd3173c9a46979bac35e654d7d0771e
removing some off-main-thread usage of AudioNodeEngine::mNode.
MozReview-Commit-ID: GYgFzPJQjjm
--HG--
extra : rebase_source : 9c4697b27bdfee971d9502c4b0573cdb7c740774
This removes the unnecessary setting of c-basic-offset from all
python-mode files.
This was automatically generated using
perl -pi -e 's/; *c-basic-offset: *[0-9]+//'
... on the affected files.
The bulk of these files are moz.build files but there a few others as
well.
MozReview-Commit-ID: 2pPf3DEiZqx
--HG--
extra : rebase_source : 0a7dcac80b924174a2c429b093791148ea6ac204
Passing infinite values into an AudioParam will trigger an assert in debug
builds. Returning early here mimics the non-debug behaviour of refusing to
insert an event with an infinite value.
MozReview-Commit-ID: BaAtiAnh1s
--HG--
extra : rebase_source : 29b0e9a1f889c96725afb3abb71541e485330433
extra : histedit_source : 9281990becd2fbc934e121675d3075a40158049d
Running the test-case in the bug, and profiling under OSX using Instruments'
time profiler, the time spent in `AudioEventTimeline::ValidateEvent` was the
highest Web Audio API-related function. This patch makes it disappear from the
profile. We already use the same technique on the MSG thread to keep the number
of events low.
MozReview-Commit-ID: GJLPRWBh7nQ
This can reduce the include header dependency. MediaStreamVideoSink will inherit from DirectMediaStreamTrackListener. But we can't use forward declaration on MediaStreamListener because the usage of nsTArray<RefPtr<MediaStreamVideoSink>>.
MozReview-Commit-ID: 328s4Kw9NvW
--HG--
extra : transplant_source : %D2%18%E3%3B%0C%D8%F04%F3%EB%EB%A0%A7%8B%B1%A9%AB%97rY
This means if WebAudio is using the Adobe GMP for decoding and it crashes,
we'll get a crash report for the GMP.
MozReview-Commit-ID: FOZoPxvUwq5
--HG--
extra : rebase_source : 0641e4c46619693b2983a7d7297af525f1ac5bea
with the new variable matching the loop exit status of interest.
MozReview-Commit-ID: 8xy5ipo4trp
--HG--
extra : rebase_source : e951177af0699a550a4fb56a6192720207e74cb2
|bailout| is reset for each aTime, so that the appropriate events for that
time can be found.
The |eventIndex| loop is adjusted so that, when it is re-entered, it keeps
the current set of events if they are appropriate (instead of advancing
every time it is entered).
|previous| and |next| are now advanced even when passing the last event,
removing the special case when past all events.
MozReview-Commit-ID: 8ZSIzKKGQbd
--HG--
extra : rebase_source : bfc899287abaf12d5cdbfbc1b22d6626ab2299dd
This is not necessarily related to the last event and it is not the
previous event.
MozReview-Commit-ID: 6hhv184BHfg
--HG--
extra : rebase_source : 8013606e27a159bb2598217db40df926539227c6
This limits recompilation required when modifying the methods, and
makes the public interface easier to read.
MozReview-Commit-ID: Lo2f7xmIdGu
--HG--
rename : dom/media/webaudio/AudioEventTimeline.h => dom/media/webaudio/AudioEventTimeline.cpp
extra : rebase_source : 75586bb320dd2e5606e691919b1c6a7c48c2065f
The comment was not necessarily true where it was previously positioned.
MozReview-Commit-ID: FMYkGkmuvVS
--HG--
extra : rebase_source : a6ae6958b9486c92c7830fcc334dac66c643dc29