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);
|
aReflector);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AudioWorkletGlobalScope::RegisterProcessor(JSContext* aCx,
|
void AudioWorkletGlobalScope::RegisterProcessor(
|
||||||
const nsAString& aName,
|
JSContext* aCx, const nsAString& aName,
|
||||||
VoidFunction& aProcessorCtor,
|
AudioWorkletProcessorConstructor& aProcessorCtor, ErrorResult& aRv) {
|
||||||
ErrorResult& aRv) {
|
|
||||||
JS::Rooted<JSObject*> processorConstructor(aCx,
|
JS::Rooted<JSObject*> processorConstructor(aCx,
|
||||||
aProcessorCtor.CallableOrNull());
|
aProcessorCtor.CallableOrNull());
|
||||||
|
|
||||||
|
@ -18,6 +18,8 @@ class AudioWorkletImpl;
|
|||||||
|
|
||||||
namespace dom {
|
namespace dom {
|
||||||
|
|
||||||
|
class AudioWorkletProcessorConstructor;
|
||||||
|
|
||||||
class AudioWorkletGlobalScope final : public WorkletGlobalScope {
|
class AudioWorkletGlobalScope final : public WorkletGlobalScope {
|
||||||
public:
|
public:
|
||||||
NS_DECL_ISUPPORTS_INHERITED
|
NS_DECL_ISUPPORTS_INHERITED
|
||||||
@ -30,7 +32,8 @@ class AudioWorkletGlobalScope final : public WorkletGlobalScope {
|
|||||||
JS::MutableHandle<JSObject*> aReflector) override;
|
JS::MutableHandle<JSObject*> aReflector) override;
|
||||||
|
|
||||||
void RegisterProcessor(JSContext* aCx, const nsAString& aName,
|
void RegisterProcessor(JSContext* aCx, const nsAString& aName,
|
||||||
VoidFunction& aProcessorCtor, ErrorResult& aRv);
|
AudioWorkletProcessorConstructor& aProcessorCtor,
|
||||||
|
ErrorResult& aRv);
|
||||||
|
|
||||||
WorkletImpl* Impl() const override;
|
WorkletImpl* Impl() const override;
|
||||||
|
|
||||||
@ -56,7 +59,7 @@ class AudioWorkletGlobalScope final : public WorkletGlobalScope {
|
|||||||
double mCurrentTime;
|
double mCurrentTime;
|
||||||
float mSampleRate;
|
float mSampleRate;
|
||||||
|
|
||||||
typedef nsRefPtrHashtable<nsStringHashKey, VoidFunction>
|
typedef nsRefPtrHashtable<nsStringHashKey, AudioWorkletProcessorConstructor>
|
||||||
NodeNameToProcessorDefinitionMap;
|
NodeNameToProcessorDefinitionMap;
|
||||||
NodeNameToProcessorDefinitionMap mNameToProcessorMap;
|
NodeNameToProcessorDefinitionMap mNameToProcessorMap;
|
||||||
};
|
};
|
||||||
|
@ -7,10 +7,12 @@
|
|||||||
* https://webaudio.github.io/web-audio-api/#audioworkletglobalscope
|
* https://webaudio.github.io/web-audio-api/#audioworkletglobalscope
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
callback constructor AudioWorkletProcessorConstructor = AudioWorkletProcessor (object options);
|
||||||
|
|
||||||
[Global=(Worklet,AudioWorklet),Exposed=AudioWorklet]
|
[Global=(Worklet,AudioWorklet),Exposed=AudioWorklet]
|
||||||
interface AudioWorkletGlobalScope : WorkletGlobalScope {
|
interface AudioWorkletGlobalScope : WorkletGlobalScope {
|
||||||
[Throws]
|
[Throws]
|
||||||
void registerProcessor (DOMString name, VoidFunction processorCtor);
|
void registerProcessor (DOMString name, AudioWorkletProcessorConstructor processorCtor);
|
||||||
readonly attribute unsigned long long currentFrame;
|
readonly attribute unsigned long long currentFrame;
|
||||||
readonly attribute double currentTime;
|
readonly attribute double currentTime;
|
||||||
readonly attribute float sampleRate;
|
readonly attribute float sampleRate;
|
||||||
|
Loading…
Reference in New Issue
Block a user