mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 1542931 Add AudioWorkletProcessorConstructor r=bzbarsky
https://github.com/WebAudio/web-audio-api/issues/1839 Depends on D34476 Differential Revision: https://phabricator.services.mozilla.com/D34477 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
f94d893bf3
commit
0d0c740557
@ -39,10 +39,9 @@ bool AudioWorkletGlobalScope::WrapGlobalObject(
|
||||
aReflector);
|
||||
}
|
||||
|
||||
void AudioWorkletGlobalScope::RegisterProcessor(JSContext* aCx,
|
||||
const nsAString& aName,
|
||||
VoidFunction& aProcessorCtor,
|
||||
ErrorResult& aRv) {
|
||||
void AudioWorkletGlobalScope::RegisterProcessor(
|
||||
JSContext* aCx, const nsAString& aName,
|
||||
AudioWorkletProcessorConstructor& aProcessorCtor, ErrorResult& aRv) {
|
||||
JS::Rooted<JSObject*> processorConstructor(aCx,
|
||||
aProcessorCtor.CallableOrNull());
|
||||
|
||||
|
@ -18,6 +18,8 @@ class AudioWorkletImpl;
|
||||
|
||||
namespace dom {
|
||||
|
||||
class AudioWorkletProcessorConstructor;
|
||||
|
||||
class AudioWorkletGlobalScope final : public WorkletGlobalScope {
|
||||
public:
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
@ -30,7 +32,8 @@ class AudioWorkletGlobalScope final : public WorkletGlobalScope {
|
||||
JS::MutableHandle<JSObject*> aReflector) override;
|
||||
|
||||
void RegisterProcessor(JSContext* aCx, const nsAString& aName,
|
||||
VoidFunction& aProcessorCtor, ErrorResult& aRv);
|
||||
AudioWorkletProcessorConstructor& aProcessorCtor,
|
||||
ErrorResult& aRv);
|
||||
|
||||
WorkletImpl* Impl() const override;
|
||||
|
||||
@ -56,7 +59,7 @@ class AudioWorkletGlobalScope final : public WorkletGlobalScope {
|
||||
double mCurrentTime;
|
||||
float mSampleRate;
|
||||
|
||||
typedef nsRefPtrHashtable<nsStringHashKey, VoidFunction>
|
||||
typedef nsRefPtrHashtable<nsStringHashKey, AudioWorkletProcessorConstructor>
|
||||
NodeNameToProcessorDefinitionMap;
|
||||
NodeNameToProcessorDefinitionMap mNameToProcessorMap;
|
||||
};
|
||||
|
@ -7,10 +7,12 @@
|
||||
* https://webaudio.github.io/web-audio-api/#audioworkletglobalscope
|
||||
*/
|
||||
|
||||
callback constructor AudioWorkletProcessorConstructor = AudioWorkletProcessor (object options);
|
||||
|
||||
[Global=(Worklet,AudioWorklet),Exposed=AudioWorklet]
|
||||
interface AudioWorkletGlobalScope : WorkletGlobalScope {
|
||||
[Throws]
|
||||
void registerProcessor (DOMString name, VoidFunction processorCtor);
|
||||
void registerProcessor (DOMString name, AudioWorkletProcessorConstructor processorCtor);
|
||||
readonly attribute unsigned long long currentFrame;
|
||||
readonly attribute double currentTime;
|
||||
readonly attribute float sampleRate;
|
||||
|
Loading…
Reference in New Issue
Block a user