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..c6689db387b48c883973dffd34555e2d062ac4c6 |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/modules/webaudio/AudioWorkletProcessor.h |
| @@ -0,0 +1,55 @@ |
| +// 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 "modules/ModulesExport.h" |
| +#include "modules/webaudio/AudioWorkletGlobalScope.h" |
| +#include "platform/heap/Handle.h" |
| +#include "v8/include/v8.h" |
| +#include "wtf/text/WTFString.h" |
| + |
| +namespace blink { |
| + |
| +class AudioBuffer; |
| +class AudioWorkletGlobalScope; |
|
nhiroki
2017/03/16 00:21:36
We already included AWGS.h
hongchan
2017/03/16 22:11:29
I removed the header from the inclusion.
|
| +class AudioWorkletProcessorDefinition; |
| + |
| +// AudioWorkletProcessor class represents the active instance created from |
| +// AudioWorkletProcessorDefinition. |AudioWorkletNodeHandler| invokes |
| +// process() method in this object upon graph rendering. |
| +// |
| +// This is constructed and destroyed on a worker thread, and all methods also |
| +// must be called on the worker thread. |
| +class MODULES_EXPORT AudioWorkletProcessor |
| + : public GarbageCollectedFinalized<AudioWorkletProcessor> { |
| + public: |
| + static AudioWorkletProcessor* create(AudioWorkletGlobalScope*, |
| + const String& name); |
| + virtual ~AudioWorkletProcessor(); |
| + |
| + void setInstance(v8::Isolate*, v8::Local<v8::Object> instance); |
| + |
| + v8::Local<v8::Object> instanceLocal(v8::Isolate*); |
| + |
| + // |AudioWorkletHandler| invokes this method to process audio. |
| + void process(AudioBuffer* inputBuffer, AudioBuffer* outputBuffer); |
| + |
| + const String& name() const { return m_name; } |
| + |
| + DECLARE_TRACE(); |
| + |
| + private: |
| + AudioWorkletProcessor(AudioWorkletGlobalScope*, const String& name); |
| + |
| + Member<AudioWorkletGlobalScope> m_globalScope; |
| + String m_name; |
|
nhiroki
2017/03/16 00:21:36
const?
hongchan
2017/03/16 22:11:29
Done.
|
| + ScopedPersistent<v8::Object> m_instance; |
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // AudioWorkletProcessor_h |