Chromium Code Reviews| Index: third_party/WebKit/Source/modules/webaudio/AudioWorkletProcessor.h |
| diff --git a/third_party/WebKit/Source/modules/webaudio/AudioWorkletProcessor.h b/third_party/WebKit/Source/modules/webaudio/AudioWorkletProcessor.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..ef0670be75f4e85b721e9711bdb632b62993a6bc |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/modules/webaudio/AudioWorkletProcessor.h |
| @@ -0,0 +1,48 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef AudioWorkletProcessor_h |
| +#define AudioWorkletProcessor_h |
| + |
| +#include "bindings/core/v8/ScopedPersistent.h" |
| +#include "platform/heap/Handle.h" |
| +#include "v8/include/v8.h" |
| + |
| +namespace blink { |
| + |
| +class AudioBuffer; |
| +class AudioWorkletGlobalScope; |
| +class AudioWorkletProcessorDefinition; |
| + |
| +// AudioWorkletProcessor class represents the active instance created from |
| +// AudioWorkletProcessorDefinition. |AudioWorkletNodeHandler| invokes |
| +// process() method in this object upon graph rendering. |
| +class AudioWorkletProcessor |
| + : public GarbageCollectedFinalized<AudioWorkletProcessor> { |
| + public: |
| + static AudioWorkletProcessor* create(const String& name, |
| + AudioWorkletGlobalScope*); |
| + virtual ~AudioWorkletProcessor(); |
| + |
| + // TODO: AudioWorkletHandler must serve |
| + // - inputs: sequence<AudioBuffer> |
| + // - outputs: sequence<AudioBuffer> |
| + // - parameters: Object |
| + bool process(AudioBuffer* inputBuffer, AudioBuffer* outputBuffer); |
| + |
| + // TODO: |
| + // Implement event handler and messaging features. |
| + |
| + DECLARE_TRACE(); |
| + |
| + private: |
| + AudioWorkletProcessor(AudioWorkletProcessorDefinition*); |
|
haraken
2017/03/06 11:51:12
Add explicit.
hongchan
2017/03/06 20:06:12
Done.
|
| + |
| + Member<AudioWorkletProcessorDefinition> m_definition; |
| + v8::Local<v8::Object> m_instance; |
|
haraken
2017/03/06 11:51:12
You should not use v8::Local on a heap-allocated o
hongchan
2017/03/06 20:06:12
Done.
|
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // AudioWorkletProcessor_h |