#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "third_party/blink/renderer/modules/webaudio/audio_worklet_processor.h"
#include <memory>
#include "third_party/blink/renderer/bindings/core/v8/worker_or_worklet_script_controller.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_blink_audio_worklet_process_callback.h"
#include "third_party/blink/renderer/core/messaging/message_port.h"
#include "third_party/blink/renderer/core/workers/worker_global_scope.h"
#include "third_party/blink/renderer/modules/webaudio/audio_buffer.h"
#include "third_party/blink/renderer/modules/webaudio/audio_worklet_global_scope.h"
#include "third_party/blink/renderer/modules/webaudio/audio_worklet_processor_definition.h"
#include "third_party/blink/renderer/platform/audio/audio_bus.h"
#include "third_party/blink/renderer/platform/instrumentation/instance_counters.h"
#include "third_party/blink/renderer/platform/instrumentation/tracing/trace_event.h"
namespace blink {
AudioWorkletProcessor* AudioWorkletProcessor::Create(
ExecutionContext* context,
ExceptionState& exception_state) { … }
AudioWorkletProcessor::AudioWorkletProcessor(
AudioWorkletGlobalScope* global_scope,
const String& name,
MessagePort* port)
: … { … }
AudioWorkletProcessor::~AudioWorkletProcessor() { … }
bool AudioWorkletProcessor::Process(
const Vector<scoped_refptr<AudioBus>>& inputs,
Vector<scoped_refptr<AudioBus>>& outputs,
const HashMap<String, std::unique_ptr<AudioFloatArray>>& param_value_map) { … }
void AudioWorkletProcessor::SetErrorState(
AudioWorkletProcessorErrorState error_state) { … }
AudioWorkletProcessorErrorState AudioWorkletProcessor::GetErrorState() const { … }
bool AudioWorkletProcessor::hasErrorOccurred() const { … }
MessagePort* AudioWorkletProcessor::port() const { … }
void AudioWorkletProcessor::Trace(Visitor* visitor) const { … }
bool AudioWorkletProcessor::PortTopologyMatches(
v8::Isolate* isolate,
v8::Local<v8::Context> context,
const Vector<scoped_refptr<AudioBus>>& audio_port_1,
const TraceWrapperV8Reference<v8::Array>& audio_port_2) { … }
bool AudioWorkletProcessor::FreezeAudioPort(
v8::Isolate* isolate,
v8::Local<v8::Context> context,
v8::Local<v8::Array>& audio_port_array) { … }
bool AudioWorkletProcessor::ClonePortTopology(
v8::Isolate* isolate,
v8::Local<v8::Context> context,
const Vector<scoped_refptr<AudioBus>>& audio_port_1,
TraceWrapperV8Reference<v8::Array>& audio_port_2,
BackingArrayBuffers& array_buffers) { … }
void AudioWorkletProcessor::CopyPortToArrayBuffers(
v8::Isolate* isolate,
const Vector<scoped_refptr<AudioBus>>& audio_port,
BackingArrayBuffers& array_buffers) { … }
void AudioWorkletProcessor::CopyArrayBuffersToPort(
v8::Isolate* isolate,
const BackingArrayBuffers& array_buffers,
Vector<scoped_refptr<AudioBus>>& audio_port) { … }
void AudioWorkletProcessor::ZeroArrayBuffers(
v8::Isolate* isolate,
const BackingArrayBuffers& array_buffers) { … }
bool AudioWorkletProcessor::ParamValueMapMatchesToParamsObject(
v8::Isolate* isolate,
v8::Local<v8::Context> context,
const HashMap<String, std::unique_ptr<AudioFloatArray>>& param_value_map,
const TraceWrapperV8Reference<v8::Object>& params) { … }
bool AudioWorkletProcessor::CloneParamValueMapToObject(
v8::Isolate* isolate,
v8::Local<v8::Context> context,
const HashMap<String, std::unique_ptr<AudioFloatArray>>& param_value_map,
TraceWrapperV8Reference<v8::Object>& params) { … }
bool AudioWorkletProcessor::CopyParamValueMapToObject(
v8::Isolate* isolate,
v8::Local<v8::Context> context,
const HashMap<String, std::unique_ptr<AudioFloatArray>>& param_value_map,
TraceWrapperV8Reference<v8::Object>& params) { … }
}