Chromium Code Reviews| Index: third_party/WebKit/Source/modules/webaudio/AudioWorkletGlobalScope.h |
| diff --git a/third_party/WebKit/Source/modules/webaudio/AudioWorkletGlobalScope.h b/third_party/WebKit/Source/modules/webaudio/AudioWorkletGlobalScope.h |
| index 590a3a3300b7a5496d6a87b6782cb93b1cc04045..9c643afad3bcf7f26489e300e9a2491c1f96df94 100644 |
| --- a/third_party/WebKit/Source/modules/webaudio/AudioWorkletGlobalScope.h |
| +++ b/third_party/WebKit/Source/modules/webaudio/AudioWorkletGlobalScope.h |
| @@ -5,11 +5,22 @@ |
| #ifndef AudioWorkletGlobalScope_h |
| #define AudioWorkletGlobalScope_h |
| +#include "bindings/core/v8/ScriptValue.h" |
| +#include "core/dom/ExecutionContext.h" |
| #include "core/workers/ThreadedWorkletGlobalScope.h" |
| +#include "modules/ModulesExport.h" |
| namespace blink { |
| -class AudioWorkletGlobalScope final : public ThreadedWorkletGlobalScope { |
| +class ExceptionState; |
| +class AudioBuffer; |
| +class AudioWorkletProcessor; |
| +class AudioWorkletProcessorDefinition; |
| + |
| +// This is constructed and destroyed on a worker thread, and all methods also |
| +// must be called on the worker thread. |
| +class MODULES_EXPORT AudioWorkletGlobalScope final |
| + : public ThreadedWorkletGlobalScope { |
| DEFINE_WRAPPERTYPEINFO(); |
| public: |
| @@ -19,6 +30,23 @@ class AudioWorkletGlobalScope final : public ThreadedWorkletGlobalScope { |
| v8::Isolate*, |
| WorkerThread*); |
| ~AudioWorkletGlobalScope() override; |
| + void dispose() final; |
| + bool isAudioWorkletGlobalScope() const final { return true; } |
| + void registerProcessor(ScriptState*, |
| + const String& name, |
| + const ScriptValue& classDefinition, |
| + ExceptionState&); |
| + |
| + // Create an instance of AudioWorkletProcessor from a registered name. |
|
nhiroki
2017/03/10 15:30:13
s/Create/Creates/
Can you mention this function m
hongchan
2017/03/15 22:30:18
Done.
|
| + AudioWorkletProcessor* createInstance(const String& name); |
| + |
| + bool process(AudioWorkletProcessor*, |
| + AudioBuffer* inputBuffer, |
| + AudioBuffer* outputBuffer); |
| + |
| + AudioWorkletProcessorDefinition* findDefinition(const String& name); |
|
nhiroki
2017/03/10 15:30:13
Can you move this to the "private" section?
hongchan
2017/03/15 22:30:18
I ended up using this method in the testing. If yo
|
| + |
| + DECLARE_TRACE(); |
| private: |
| AudioWorkletGlobalScope(const KURL&, |
| @@ -26,6 +54,13 @@ class AudioWorkletGlobalScope final : public ThreadedWorkletGlobalScope { |
| PassRefPtr<SecurityOrigin>, |
| v8::Isolate*, |
| WorkerThread*); |
| + |
| + typedef HeapHashMap<String, Member<AudioWorkletProcessorDefinition>> |
| + ProcessorDefinitionMap; |
| + typedef HeapVector<Member<AudioWorkletProcessor>> ProcessorInstances; |
| + |
| + ProcessorDefinitionMap m_processorDefinitionMap; |
| + ProcessorInstances m_processorInstances; |
| }; |
| } // namespace blink |