Bug 1724997 - Put the AudioWorkletProcessor's name in the marker when calling its process method. r=karlt

Differential Revision: https://phabricator.services.mozilla.com/D122740
This commit is contained in:
Paul Adenot 2021-08-26 09:15:40 +00:00
Родитель cd9af3411c
Коммит 0d92e0b339
1 изменённых файлов: 5 добавлений и 2 удалений

Просмотреть файл

@ -146,6 +146,7 @@ class WorkletNodeEngine final : public AudioNodeEngine {
mProcessor.reset(); mProcessor.reset();
} }
nsCString mProcessorName;
RefPtr<AudioNodeTrack> mDestination; RefPtr<AudioNodeTrack> mDestination;
nsTArray<uint32_t> mOutputChannelCount; nsTArray<uint32_t> mOutputChannelCount;
nsTArray<NamedAudioParamTimeline> mParamTimelines; nsTArray<NamedAudioParamTimeline> mParamTimelines;
@ -264,6 +265,7 @@ void WorkletNodeEngine::ConstructProcessor(
SendProcessorError(aTrack, nullptr); SendProcessorError(aTrack, nullptr);
return; return;
} }
mProcessorName = NS_ConvertUTF16toUTF8(aName);
JSContext* cx = api.cx(); JSContext* cx = api.cx();
mProcessor.init(cx); mProcessor.init(cx);
if (!global->ConstructProcessor(cx, aName, aSerializedOptions, if (!global->ConstructProcessor(cx, aName, aSerializedOptions,
@ -419,7 +421,7 @@ static bool PrepareBufferArrays(JSContext* aCx, Span<const AudioBlock> aBlocks,
// do not run until after ProcessBlocksOnPorts() has returned. // do not run until after ProcessBlocksOnPorts() has returned.
bool WorkletNodeEngine::CallProcess(AudioNodeTrack* aTrack, JSContext* aCx, bool WorkletNodeEngine::CallProcess(AudioNodeTrack* aTrack, JSContext* aCx,
JS::Handle<JS::Value> aCallable) { JS::Handle<JS::Value> aCallable) {
TRACE("AudioWorkletNodeEngine::CallProcess"); TRACE_COMMENT("AudioWorkletNodeEngine::CallProcess", mProcessorName.get());
JS::RootedVector<JS::Value> argv(aCx); JS::RootedVector<JS::Value> argv(aCx);
if (NS_WARN_IF(!argv.resize(3))) { if (NS_WARN_IF(!argv.resize(3))) {
@ -656,7 +658,8 @@ already_AddRefed<AudioWorkletNode> AudioWorkletNode::Constructor(
const GlobalObject& aGlobal, AudioContext& aAudioContext, const GlobalObject& aGlobal, AudioContext& aAudioContext,
const nsAString& aName, const AudioWorkletNodeOptions& aOptions, const nsAString& aName, const AudioWorkletNodeOptions& aOptions,
ErrorResult& aRv) { ErrorResult& aRv) {
TRACE_COMMENT("AudioWorkletNode::Constructor", "%s", NS_ConvertUTF16toUTF8(aName).get()); TRACE_COMMENT("AudioWorkletNode::Constructor", "%s",
NS_ConvertUTF16toUTF8(aName).get());
/** /**
* 1. If nodeName does not exist as a key in the BaseAudioContexts node * 1. If nodeName does not exist as a key in the BaseAudioContexts node
* name to parameter descriptor map, throw a InvalidStateError exception * name to parameter descriptor map, throw a InvalidStateError exception